LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 06: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 06:56 AM.
 
Old 07-27-2011, 06:57 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 04: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, 08:25 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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



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 01:00 AM
encrypt and decrypt using encrypt(char block[64], int edflag) rockwell_001 Linux - Security 3 08-30-2009 09:16 AM
Encrypt/Decrypt file in Linux , How to ? shipon_97 Linux - Newbie 1 09-05-2007 03:35 AM
How to use kgpg to encrypt and decrypt emails? ginda Linux - Security 6 03-16-2005 09:42 PM
2048-bit encrypt/decrypt help Nappa Slackware 1 11-20-2003 11:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:50 PM.

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
Open Source Consulting | Domain Registration