LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2011, 07:36 AM   #1
manish72
LQ Newbie
 
Registered: Mar 2011
Posts: 11

Rep: Reputation: 0
encrypt and decrypt password in .profile


Hi ,

how do i encrypt & decrypt password in a file for secuiry reason ? is there any shell scripts available to do the same?

OS : aix 5.3

Regards,
Raghu

Last edited by manish72; 07-27-2011 at 07:56 AM.
 
Old 07-27-2011, 07:57 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Usually with passwds in eg /etc/shadow, they are hashed using eg md5sum (& a 'salt')and the hash is stored. Then when someone attempts to login, the system hashes the input with the salt and checks to see if the result is the same as the stored hash.
The passwd is never actually un-hashed/de-crypted.

HTH
PS I'm assuming AIX uses /etc/shadow; if not try /etc/passwd
 
Old 07-28-2011, 05:24 AM   #3
manish72
LQ Newbie
 
Registered: Mar 2011
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
Usually with passwds in eg /etc/shadow, they are hashed using eg md5sum (& a 'salt')and the hash is stored. Then when someone attempts to login, the system hashes the input with the salt and checks to see if the result is the same as the stored hash.
The passwd is never actually un-hashed/de-crypted.

HTH
PS I'm assuming AIX uses /etc/shadow; if not try /etc/passwd


Thanks for you reply . Actually my question was i have a file ( .profile ) in home directory(shared account) which had hardcoded password in a variable;i want to encrypt the password in .profile so that the user will not be knowing the password.

Regards,
Raghu
 
Old 07-28-2011, 09:25 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Given you are on AIX, you could try https://secure.wikimedia.org/wikiped...ypt_%28Unix%29, although I'm not sure how strong it would be as per the article.
Best to read the man page for crypt on your system.

Alternatives may include gpg http://linux.die.net/man/1/gpg, openssl http://linux.die.net/man/1/openssl, but they may not be installed.
Best guess is to read the man page for crypt and to look at the bottom where it may reference other related tools/cmds.
Also, try to google 'AIX encrypt' or similar.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypt/decrypt from linux console ReshmiS Linux - Newbie 3 02-09-2010 02:00 AM
encrypt and decrypt using encrypt(char block[64], int edflag) rockwell_001 Linux - Security 3 08-30-2009 10:16 AM
Encrypt/Decrypt file in Linux , How to ? shipon_97 Linux - Newbie 1 09-05-2007 04:35 AM
How to use kgpg to encrypt and decrypt emails? ginda Linux - Security 6 03-16-2005 10:42 PM
2048-bit encrypt/decrypt help Nappa Slackware 1 11-20-2003 12:04 PM


All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration