Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I create a random 64 bit key for DEC ECB encryption/decryption, and then use the same key for encryption/decryption many times? All this must be done using openssl command line tool.

In all the examples I have seen, they do not use a "key", they use "password". But I need a key - array of bytes - because I need to send it to the other party (I don't know which API they use for cryptography.)

Then I need to use this key - array of bytes - to encrypt/decrypt data.

Thnak you

share|improve this question

migrated from Feb 23 '11 at 23:10

This question came from our site for professional and enthusiast programmers.

add a -K 0123456789abcdef to your command. From openssl enc help:

-K/-iv         key/iv in hex is the next argument
share|improve this answer
Thanks. But how can I generate this key using the openssl command line tool? – smsrecv Feb 22 '11 at 9:22
You can use the rand routine. – Jumbogram Feb 22 '11 at 15:03

You must log in to answer this question.