Forum

Challenge "AES key — encoded in the machine readable zone of a European ePassport"  

  By: admin on Jan. 16, 2012, 7:05 p.m.

An AES encrypted message has been forwarded to you. Additionally, you have received the corresponding key - unfortunately not quite complete - in a form like a machine readable zone on an identity document as it is used e.g. with ePassports in Europe.
Read more...

 Last edited by: admin on Oct. 31, 2021, 2:54 a.m., edited 1 time in total.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: DarkFibre on Jan. 16, 2012, 10:26 p.m.

That was fun, thanks!

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 16, 2012, 11:10 p.m.

What is done to the D before hash is applied?

  1. Concatenate Kseed and c:
    D = ‘239AB9CB282DAF66231DC5A4DF6BFBAE00000001’
  2. Calculate the SHA-1 hash of D:
    HSHA-1(D) = ‘AB94FCEDF2664EDFB9B291F85D7F77F27F2F4A9D’

The hash of the above D is "1D3D2D9AC8826BD53A915A73BCFD2A5D8A01512B" not as it is written in the PDF-s.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 17, 2012, 1:54 a.m.

Moreover, the "MRZ key" is not correct.
In the challenge there is:
12345678<8<<<1110182<111116?<<<<<<<<<<<<<<<4
But according to the reference PDF-s the key should end in 2.
If you compute the missing digit "?" and then the last digit which is called "Composite check digit", you get 2.

Although the last digit is irrelevant for the solution of this challenge (as I see we do not need that last digit in the whole process), it is quite annoying when the things do not correspond to what is written in the challenge and in the references.

I still can not figure out what SHA-1 algorithm they used, but am I sure it is not the standard one or there is missing one step in the description.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Secrethunder on Jan. 17, 2012, 10:40 a.m.

What is done to the D before hash is applied?

  1. Concatenate Kseed and c:
    D = ‘239AB9CB282DAF66231DC5A4DF6BFBAE00000001’
  2. Calculate the SHA-1 hash of D:
    HSHA-1(D) = ‘AB94FCEDF2664EDFB9B291F85D7F77F27F2F4A9D’

The hash of the above D is "1D3D2D9AC8826BD53A915A73BCFD2A5D8A01512B" not as it is written in the PDF-s.

The H[size=85]SHA-1/size that is written under 2. is correct.
Please reconsider the coding format that is used here.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 17, 2012, 1:41 p.m.

Sorry, I do not get it what you mean.

If on the one hand
H_sha1(L898902C<369080619406236)=239AB9CB282DAF66231DC5A4DF6BFBAEDF477565

then on the other
H_sha1(239AB9CB282DAF66231DC5A4DF6BFBAE00000001)=1D3D2D9AC8826BD53A915A73BCFD2A5D8A01512B

If there is something more to do to "D" before applying hash then it should be mentioned in the description. But there is nothing that seems to suggest that we should change the coding format of "D".

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 17, 2012, 3:24 p.m.

Another question.
What algorithm is supposed to be used for decryption?
In the challenge there is mentioned AES (CBC mode).
In reference they call it 3DES.
So is it Triple DES or AES or what?
According to wikipedia Triple DES and AES are different algorithms, so how can we use both names to refer to one particular algorithm?

 Last edited by: Veselovský on Jan. 17, 2012, 6:44 p.m., edited 1 time in total.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 17, 2012, 3:30 p.m.

I have just solved it by myself.
Good look everybody…

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 17, 2012, 6:42 p.m.

By the way, I still insist that the "MRZ key" is not correct and as I already solved the challenge I know that the last digit really should be 2, not 4.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 17, 2012, 11:33 p.m.

Double check your math on the other fields and you will probably find those checks to be "wrong," too.

No I did not find anything else to be "wrong". Everything else is OK, just the last one digit (Composite check digit) in the challenge key is wrong. I checked it many times.

In the reference PDF-s there are two examples of keys (red digits are first four check digits and yellow is the Composite check digit):
HA672242<6UTO5802254M9601086<<<<<<<<<<<<<<08
L898902C<3UTO6908061F9406236ZE184226B<<<<<14

These two examples are correct and comply with the description how to compute check digits, but if I do exactly same with the key from the challenge I get 2 in the place of the last digit.

Maybe the document is not poorly written, but perhaps just written for people that are highly involved in that area of "readable documents" and do not need detailed description.

EDIT: There was a DarkFibre's post before this one. This is the response to his post, that has disappeared.

 Last edited by: Veselovský on Jan. 17, 2012, 11:46 p.m., edited 2 times in total.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: jomandi on Jan. 18, 2012, 7:30 p.m.

i think, that i have the right key and the right base64decoded ciphertext.
but i do not get a meaningful plaintext.

for me I (capital i) and l (small L) it is not distinguishable.

can someone post the ciphertext of the challenge here in the forum in a nonambiguous way?

thanks,
jomandi

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 18, 2012, 7:44 p.m.

Yes, in the font they are using in PDF-s, "capital i" and "small L" look exactly same for human eyes, but not for computer. If you copy it directly from PDF and paste to some other application with better font you should be able to distinguish them.
If you need it anyway, here it is:
9MgYwmuPrjiecPMx61O6zIuy3MtIXQQ0E59T3xB6u0Gyf1gYs2i3K9Jxaa0zj4gTMazJuApwd6+jdyeI5iGHvhQyDHGVlAuYTgJrbFDrfB22Fpil2NfNnWFBTXyf7SDI

P.S.: If you have time, please check the last digit of the MRZ key to confirm or deny my assertion, that the challenge MRZ key is not correct.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Veselovský on Jan. 18, 2012, 8:05 p.m.

I have verified it by online Machine Readable Passport MRZ Analyzer. I was right.
The result was:
Check digit 1: Okay (8)
Check digit 2: Okay (2)
Check digit 3: Okay (?)
Check digit 4: Okay (0)
Final Check digit: Invalid (Is 4, should be 2)

I put here "?" instead of real digit to not disclose its value to other users.

Re: Challenge "AES key - encoded in the machine readable..."  

  By: jomandi on Jan. 18, 2012, 8:19 p.m.

@veselovsky
thanks for your reply. copy@paste worked correcly, so the input string is the right one. there must be another mistake…

the last digit problem:
when you calculate the last digit correctly, then the result is 2, as you mentioned.

for the correct calculations, you take the second line, remove the 3 digits of the country and 1 digit of the gender. then you calculate the checksum over the remaining 39 digits.

when you calculate over all 43 digits, then the checksum is 4. i think, that happened during the creation of the challenge.

best regards,
jomandi

Re: Challenge "AES key - encoded in the machine readable..."  

  By: Greko on Aug. 9, 2012, 2:10 p.m.

Hi
I have found the missing digit and I have followed the procedure described in the documents in order to find the AES key. Then I used cryptool (as recommended) for the decryption procedures, although I do not get a meaningful message. I repeated the steps many times in case I had made a mistake but nothing changed. Obviously there is a detail that I am missing. I would like to PM my solution to somebody that has already solved it so that we can find out what I am doing wrong.I would really appreciate it if somebody was willing to help me.

Thank you
Greko


Currently 14 guests and 0 members are online.
Powered by the CrypTool project
Contact | Privacy | Imprint
© 2009-2024 MysteryTwister team