EME-OAEP encoding of input message using a Feistel network with SHA-1 hashing and mask generation function (MGF1) (see problem 44963/below link, section 9.1.1.1 (figure 1 shows the encoding process)). Inputs will include message (M), label (L), a random seed (seed) array of octets of length 20 (needed such that outputs can be compared), and output length (k). Output (EM) array will be an array of octets of length, k. Hash length will always be 20 from SHA-1 (160-20 bytes). The character length of input message will never exceed k-42.
For example:
M = 'I like to swim.';%input
L = 'abcdefghijklmnopqrstuvwxyz';%input
seed = [147,11,108,119,5,16,236,136,93,93,38,38,89,86,200,124,118,33,226,172];%input
k = 100;%input
EM = [0,167,202,74,98,63,234,235,44,82,53,39,70,214,204,79,45,80,35,147,55,32,35,39,45,...
87,180,129,63,219,223,165,72,19,131,160,131,131,107,231,157,238,213,10,237,132,55,...
35,182,202,151,21,82,130,121,35,14,35,75,255,236,72,45,210,0,243,57,43,137,79,9,...
217,83,81,227,171,156,105,168,121,224,201,41,98,84,79,3,247,109,100,214,227,120,...
148,12,50,108,248,32,94];%output
See: https://www.foo.be/docs/opensst/ref/pkcs/pkcs-1/pkcs-1v2-1d1.pdf
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers4
Suggested Problems
-
27555 Solvers
-
Project Euler: Problem 10, Sum of Primes
2088 Solvers
-
768 Solvers
-
5761 Solvers
-
174 Solvers
More from this Author61
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Hi, David, is the problem description right? Seems that section 9.1.1 has the EME-OAEP-encode/decode pair, while 7.1.1 is another function that uses EME-OAEP, but it is not it. Moreover, how do we apply the Feistel network inside the MGF1 (disjoint sets or with intersection: 1,1,2,2,3,3,..., n n or 2 3 4 .. .n 1)? And how many rounds? 2 or more? Should the Feistel network replace the MGF1 function? Could you, please, explain?
Yes, changed description to the proper section 9.1.1.1. The steps show how the MGF1 function is used. Look at figure 1. There are not multiple rounds.
Thanks, David. I've struggled for a while with this problem but I've finally figured it out. First, although we don't use the encryption function from 7.1.1, we must create an output EM of length k-1 and apply a pad of 0 as the first character of EM (It was strange to see all hashes starting with 0). Next, I was confused with the Feistel Network, because my MGF from the previous problem wasn't working (an accepted solution), but I realized that you were probably using a hex input, instead of char (which is weird since the MGF function requires an Octect String as input), but anyway that solved it. :)