OpenSSL wrap

Hello,

To encrypt a file i use the following command line, a password will be prompted :
openssl enc -aes-256-cbc -in un_encrypted.data -out encrypted.enc

The same, to decrypt a file, i use the following command line, a password will be prompted :
openssl enc -d -aes-256-cbc -in encrypted.enc -out un_encrypted.data

Is there a Ruby Gem for that ?

Thank you very much anyway.

Cheers,

Marc.

Hi Marc,

just out of curiosiy, why do you need to bypass the shell ?

Do you need to run in Windows or some other platform not having
the "openssl" command ?

If not, you could do something as easy as:

···

------------------------------------------------
inFile = "un_encrypted.data"
outFile = "un_encrypted.data"
cmd = "openssl enc -aes-256-cbc -in #{inFile} -out #{outFile}"
system(cmd)
------------------------------------------------

CAVEAT. i did not run the snippet, there could be typos !

Bye
Nicola

On 30/11/2017 14:00, Marc wrote:

Hello,

To encrypt a file i use the following command line, a password will be prompted :
openssl enc -aes-256-cbc -in un_encrypted.data -out encrypted.enc

The same, to decrypt a file, i use the following command line, a password will be prompted :
openssl enc -d -aes-256-cbc -in encrypted.enc -out un_encrypted.data

Is there a Ruby Gem for that ?

Thank you very much anyway.

Cheers,

Marc.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

oh, sorry, sorry, my bad, i did not check .... the password thing !!!

···

On 30/11/2017 14:00, Marc wrote:

Hello,

To encrypt a file i use the following command line, a password will be prompted :
openssl enc -aes-256-cbc -in un_encrypted.data -out encrypted.enc

The same, to decrypt a file, i use the following command line, a password will be prompted :
openssl enc -d -aes-256-cbc -in encrypted.enc -out un_encrypted.data

Is there a Ruby Gem for that ?

Thank you very much anyway.

Cheers,

Marc.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

···

—
Feña

On 30. November 2017 at 14:07:45, Marc (ruby@e-solutions.re) wrote:

Hello,

To encrypt a file i use the following command line, a password will be
br/>prompted : <
openssl enc -aes-256-cbc -in un_encrypted.data -out encrypted.enc

The same, to decrypt a file, i use the following command line, a
br/>password will be prompted : <
openssl enc -d -aes-256-cbc -in encrypted.enc -out un_encrypted.data

Is there a Ruby Gem for that ?

Thank you very much anyway.

Cheers,

Marc.