Openssl issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Openssl issue
# 1  
Old 07-08-2013
Openssl issue

Hi,
I am using openssl as below for encryption of a string ( foo) and I have to pass the password twice for the same.
Code:
echo 'foo' | openssl aes-256-cbc -a -salt
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:
U2FsdGVkX1/MNPbAxaL/AYt5G8yPirMRq/AtcBMzVJc=

Is there any option to use openssl without passwords?

Thanks.

Moderator's Comments:
Mod Comment code tags please next time...

Last edited by vbe; 07-08-2013 at 05:36 AM..
# 2  
Old 07-08-2013
man openssl shows many options to automate the password:

Code:
PASS PHRASE ARGUMENTS
       Several commands accept password arguments, typically using -passin and
       -passout for input and output passwords respectively. These allow the
       password to be obtained from a variety of sources. Both of these
       options take a single argument whose format is described below. If no
       password argument is given and a password is required then the user is
       prompted to enter one: this will typically be read from the current
       terminal with echoing turned off.

       pass:password
                 the actual password is password. Since the password is visi-
                 ble to utilities (like 'ps' under Unix) this form should only
                 be used where security is not important.

       env:var   obtain the password from the environment variable var. Since
                 the environment of other processes is visible on certain
                 platforms (e.g. ps under certain Unix OSes) this option
                 should be used with caution.

       file:pathname
                 the first line of pathname is the password. If the same path-
                 name argument is supplied to -passin and -passout arguments
                 then the first line will be used for the input password and
                 the next line for the output password. pathname need not
                 refer to a regular file: it could for example refer to a
                 device or named pipe.

       fd:number read the password from the file descriptor number. This can
                 be used to send the data via a pipe for example.

       stdin     read the password from standard input.

As for leaving off the password completely, what would be the point?
# 3  
Old 07-08-2013
after you understand the man page info, check the -k option to openssl for supplying the password ...
Code:
root@debiangeek:~# echo 'foo' | openssl aes-256-cbc -a -salt -k 123abc
U2FsdGVkX19qZvtvojYJL3aTXiQL+IGoj5oMLwuxmPg=
root@debiangeek:~#

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Openssl upgrade

Hello Admins. I need to upgrade the openssl version in Solaris 10 due to vulnerabilities. When I checked the current version, it shows: bash-3.2# openssl version OpenSSL 1.0.2n 7 Dec 2017 bash-3.2# which openssl /usr/bin/openssl When I installed the new one, its getting... (0 Replies)
Discussion started by: snchaudhari2
0 Replies

2. Cybersecurity

OpenSSL

I just started playing around with Unix's OpenSSL utility. I can't seem to get the hang of it, and the man page isn't helping much. I wanted to experiment with file encryption, so I created a dummy text file with one line of text and tried to encrypt it using DES. I used the following command: ... (2 Replies)
Discussion started by: Ultrix
2 Replies

3. Red Hat

Openssl vulnerabilities

Hi there, The following openssl package are installed on the machine (openssl-1.0.0-27.el6_4.2.x86_64). It isn't the last version but I need to known if this content Vulnerabilities... How to check that on RedHat? Could you please tell me how to find this information?? Thankx (3 Replies)
Discussion started by: hiero_nymus
3 Replies

4. Red Hat

Issue w/manually installing OpenSSL 1.0.1j

My Redhat Enterprise 5 system is vulnerable to POODLE and there does not seem to be a Redhat fix coming down the pipe. So I have downloaded OpenSSL 1.0.1j from source and built it. My question is ho do I make sure the Apache and Tomcat use the1.0.1j version and not the distro version. Thanks,... (0 Replies)
Discussion started by: caspersgrin
0 Replies

5. AIX

openssl issue

Gurus, As per audit recommendation i have installed openssl.base 0.9.8.803 and upgraded openssl from 9.7l to 9.8 as prerequisits. But post these installation ssh fails with below error message. exec(): 0509-036 Cannot load program ssh because of the following errors: 0509-150 ... (3 Replies)
Discussion started by: newaix
3 Replies

6. Solaris

Openssl 0.9.8r

Hi Peeps, Having trouble compiling openssl 0.9.8r on Solaris 10 x86. The make test fails when running the shatests (segmentation faults). There is a PROBLEM file that references a file called values.c. Anyone know whereabouts in the source tree you put this file as the file doesn't tell you... (2 Replies)
Discussion started by: callmebob
2 Replies

7. UNIX for Advanced & Expert Users

Using openssl

All, I am new to openssl and I have not been able to figure out exactly how to use it. What I need to do is to create a shell script which FTPS's (SFTP is not allowed on my project) a file to a mainframe. The mainframe will not initiate a session with my server. Question. Are the packages... (7 Replies)
Discussion started by: MichaelInDC
7 Replies

8. UNIX for Dummies Questions & Answers

openssl ca ke issue

Hi everybody: here is my tale: I need to create some ssl certificates, so I did it with my Linux; I created de CA key and all the other stuff, and of course the certificates needed. The thing is I had to replace mi hard drive and I backed up all the info but I forgot to backup the /etc/ssl. Of... (0 Replies)
Discussion started by: piltrafa
0 Replies

9. UNIX for Advanced & Expert Users

openssl help

I ungraded my openssl on sun solaris 8 from openssl 0.9.6c to openssl 0.9.6g the ungrade went fine but when I tried to ssh in to server, I received the following error message "ld.so.1: ./sshd: fatal: relocation error: file /usr/local/ssl/lib/libcrypto.so.0.9.6: symbol main: referenced symbol... (2 Replies)
Discussion started by: hassan2
2 Replies
Login or Register to Ask a Question