Unix/Linux Go Back    

Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

how to encrypt a string using md5

Shell Programming and Scripting

Thread Tools Search this Thread Display Modes
Old Unix and Linux 05-12-2011
catalint catalint is offline
Registered User
Join Date: May 2011
Last Activity: 20 September 2011, 3:52 PM EDT
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
how to encrypt a string using md5

Hi there,

I want to encrypt a string (using md5 algorithm) using shell script. Any ideas?
Is possible only using sh or awk ?

I can't install md5sum on my solaris machine


Sponsored Links
Old Unix and Linux 05-12-2011
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Advisor  
Unix Daemon (Administrator Emeritus)
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,930
Thanks: 64
Thanked 471 Times in 271 Posts
Strictly speakly you can't encrypt anything with md5 because it's not an encryption algorithm. Ignoring that, you can use the digest command that appeared on Solaris 10.

On Linux:
$  echo hello | md5sum
b1946ac92492d2347c6235b4d2611184  -

And on Solaris 10:
$ echo hello | digest -a md5 /dev/fd/0

Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Encrypt and decrypt a string rohan10k Shell Programming and Scripting 5 03-17-2011 12:26 PM
Encrypt/Decrypt string with rsa keys tjones1105 Shell Programming and Scripting 1 10-24-2009 02:47 PM
need encrypt form syamkp Shell Programming and Scripting 0 03-08-2008 03:51 AM
encrypt my sctipt readycpbala Shell Programming and Scripting 4 01-24-2008 04:08 PM
Encrypt & Decrypt a String aldowsary Shell Programming and Scripting 6 05-15-2005 06:32 PM

All times are GMT -4. The time now is 09:51 AM.