7 copyedit, spelling, highlighting
source | link

For instance, letslet's say iI have this encrypted base64 string, generated with the passphrase "abc""abc":

Running this using the "abc""abc" passphrase will result in:

Now, we know that for aesAES to decrypt the data it needs the key and the Initialization Vector.

In the case of OpenSSL  , the manual says the key is generated from the passphrase and a salt, and the Initialization Vector is derived from the key itself (if not manually specified). That means that the generated data doesntdoesn't need to have the IV on it, but it does need to have the salt on it, or else the key for decryption will never be generated correctly.

So, the point is, whereswhere's the salt and howshow's it inserted in the resulting data? Doing some basic analysis on the generated data (decoding from base64 and outputting the hex values) we can see that the salt is not prepended or appended to the resulting data, but somehow it is there:

You can see that the salt "AD7E...""AD7E..." is not directly present in the encrypted data. Looks like some transformation occurred.

It looks like the salt is switched pair by pair and inserted in the data, starting on byte #9. Is this a common practice or something that only opensslOpenSSL implements?

For instance, lets say i have this encrypted base64 string, generated with the passphrase "abc":

Running this using the "abc" passphrase will result in:

Now, we know that for aes to decrypt the data it needs the key and the Initialization Vector.

In the case of OpenSSL  , the manual says the key is generated from the passphrase and a salt, and the Initialization Vector is derived from the key itself (if not manually specified). That means that the generated data doesnt need to have the IV on it, but it does need to have the salt on it, or else the key for decryption will never be generated correctly

So, the point is, wheres the salt and hows it inserted in the resulting data? Doing some basic analysis on the generated data (decoding from base64 and outputting the hex values) we can see that the salt is not prepended or appended to the resulting data, but somehow it is there:

You can see that the salt "AD7E..." is not directly present in the encrypted data. Looks like some transformation occurred.

It looks like the salt is switched pair by pair and inserted in the data, starting on byte #9. Is this a common practice or something that only openssl implements?

For instance, let's say I have this encrypted base64 string, generated with the passphrase "abc":

Running this using the "abc" passphrase will result in:

Now, we know that for AES to decrypt the data it needs the key and the Initialization Vector.

In the case of OpenSSL, the manual says the key is generated from the passphrase and a salt, and the Initialization Vector is derived from the key itself (if not manually specified). That means that the generated data doesn't need to have the IV on it, but it does need to have the salt on it, or else the key for decryption will never be generated correctly.

So, the point is, where's the salt and how's it inserted in the resulting data? Doing some basic analysis on the generated data (decoding from base64 and outputting the hex values) we can see that the salt is not prepended or appended to the resulting data, but somehow it is there:

You can see that the salt "AD7E..." is not directly present in the encrypted data. Looks like some transformation occurred.

It looks like the salt is switched pair by pair and inserted in the data, starting on byte #9. Is this a common practice or something that only OpenSSL implements?

6 cleanup and clarification and spelling
source | link

Wheres Where is the salt on the openssl aesOpenSSL AES encryption?

ImI'm interested in knowing how and where opensslOpenSSL inserts the generated salt on an AES encrypted data. Why? Im encrypting data in Java classes and need to guarantee that iI can use opensslOpenSSL to decrypt them.

Now, we know that for aes to decrypt the data it needs the key and the Initialization Vector. In

In the case of opensslOpenSSL , the manual says the key is generated from the passphrase and a salt, and the Initialization Vector is derived from the key itself (if not manually specified). That means that the generated data doesnt need to have the IV on it, but it does need to have the salt on it, or else the key for decryption will never be generated correctly

You can see that the salt "AD7E..." is not directly present in the encrypted data. Looks like some transformation occured

Thanks in advanceoccurred.

Edit

LooksIt looks like the salt is switched pair by pair and inserted in the data, starting on byte #9. Is this a common practice or something that only openssl implements?

Edit #2

Edit

Anyway, imI'm still interested in knowing if inserting the salt at the 9th byte is a common practice or an opensslOpenSSL specific implementation. I also noticed that the first bytes are the characters Salted__

Wheres the salt on the openssl aes encryption?

Im interested in knowing how and where openssl inserts the generated salt on an AES encrypted data. Why? Im encrypting data in Java classes and need to guarantee that i can use openssl to decrypt them

Now, we know that for aes to decrypt the data it needs the key and the Initialization Vector. In the case of openssl, the manual says the key is generated from the passphrase and a salt, and the Initialization Vector is derived from the key itself (if not manually specified). That means that the generated data doesnt need to have the IV on it, but it does need to have the salt on it, or else the key for decryption will never be generated correctly

You can see that the salt "AD7E..." is not directly present in the encrypted data. Looks like some transformation occured

Thanks in advance

Edit

Looks like the salt is switched pair by pair and inserted in the data, starting on byte #9. Is this a common practice or something that only openssl implements?

Edit #2

Anyway, im still interested in knowing if inserting the salt at the 9th byte is a common practice or an openssl specific implementation. I also noticed that the first bytes are the characters Salted__

Where is the salt on the OpenSSL AES encryption?

I'm interested in knowing how and where OpenSSL inserts the generated salt on an AES encrypted data. Why? Im encrypting data in Java classes and need to guarantee that I can use OpenSSL to decrypt them.

Now, we know that for aes to decrypt the data it needs the key and the Initialization Vector.

In the case of OpenSSL , the manual says the key is generated from the passphrase and a salt, and the Initialization Vector is derived from the key itself (if not manually specified). That means that the generated data doesnt need to have the IV on it, but it does need to have the salt on it, or else the key for decryption will never be generated correctly

You can see that the salt "AD7E..." is not directly present in the encrypted data. Looks like some transformation occurred.

It looks like the salt is switched pair by pair and inserted in the data, starting on byte #9. Is this a common practice or something that only openssl implements?

Edit

Anyway, I'm still interested in knowing if inserting the salt at the 9th byte is a common practice or an OpenSSL specific implementation. I also noticed that the first bytes are the characters Salted__

5 added 156 characters in body
source | link

As Thomas Pornin stated, the problem here is od -x that od -x outputs 16 bitthe raw data. As my computer is x86_64, the data is in little endian, so and the salt looks "swapped". I llhad forgotten how endianness is tricky. Now I will always remember now to use od -t x1od -t x1

Anyway, im still interested iin knowing if inserting the salt at the 9th byte is a common practice or an openssl specific implementation. I also noticed that the first bytes are the keyword "Salted__"characters Salted__

As Thomas Pornin stated, the problem here is od -x that outputs 16 bit little endian, so the salt looks "swapped". I ll always remember now to use od -t x1

Anyway, im still interested i knowing if inserting the salt at the 9th byte is a common practice or an openssl specific implementation. I also noticed that the first bytes are the keyword "Salted__"

As Thomas Pornin stated, the problem here is that od -x outputs the raw data. As my computer is x86_64, the data is in little endian and the salt looks "swapped". I had forgotten how endianness is tricky. Now I will always remember to use od -t x1

Anyway, im still interested in knowing if inserting the salt at the 9th byte is a common practice or an openssl specific implementation. I also noticed that the first bytes are the characters Salted__

4 edited tags
| link
    Tweeted twitter.com/#!/StackSecurity/status/250339177596612608
3 added 377 characters in body
source | link
2 added 383 characters in body
source | link
1
source | link