Message Boards Message Boards

Mimic GenerateSymmetricKey["password"] in openssl?

Posted 7 years ago

What are the openssl command line parameters which would produce the same key as the GenerateSymmetricKey["password"] function? For example,

key = GenerateSymmetricKey["password", 
  Method -> <|  "InitializationVector" -> None, "Cipher" -> "AES256", "BlockMode" -> "CBC"|>] ;
key["Key"]

Produces the key "7wUOXiuJb4qDpJSmxq3QULZuLxcgUnWUwle4pLn53Kc=". How could I get openssl to produce the same key given the same password, either in Hex or base64 format?

POSTED BY: O Mirza

I believe the OpenSSL command line utility cannot directly generate that key from that password. The password parameter of GenerateSymmetricKey is passed to a key derivation function called scrypt. It looks like scrypt was recently added to OpenSSL, but in libcrypto, and it doesn't look like they have an way of calling it from the command line.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract