- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- decrypt 4 digit passwd.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 01:39 PM
тАО07-06-2009 01:39 PM
echo "jaime123SP" | /usr/lib/makekey
But I am trying to do the same with a 4 digit password, but makekey is especting an 8 digit value, so I do not get it right.
How do you write the command to fill in the other 4 digits that the password does not have?
Regards,
Jaime.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 01:46 PM
тАО07-06-2009 01:46 PM
SolutionInstead of using 'makekey' you can let Perl do this thusly:
# cat ./pwgen
#!/usr/bin/perl -l
die "One arg expected\n" unless @ARGV;
print crypt(
$ARGV[0],
join( '',
( '.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z' )[ rand 64, rand 64 ] )
);
1;
...run as:
# ./pwgen plaintext
The script's output is your corresponding encrypted password.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 02:03 PM
тАО07-06-2009 02:03 PM
Re: decrypt 4 digit passwd.
I must be doing something wrong, the password is 1234
# ./pwgen 1234
/wbBjQGevNiU6
#
#
# pwget -n root
root:oLZx6qTytmexI:0:3::/:/sbin/sh
# ./pwgen 1234oL
vLzVSMAFApTr2
Strange, what am I doing wrong?
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 04:34 PM
тАО07-06-2009 04:34 PM
Re: decrypt 4 digit passwd.
> I must be doing something wrong, the password is 1234
And either 'makekey' or the Perl script I offered will encrypt that plaintext password as you saw.
If you have an encrypted password and want to see if it matches what you think it should you can do:
# perl -le '$plain=shift;$secret=shift or die;print "ok" if if crypt($plain,$secret) eq $secret' 1234oL VLzVSMAFApTr2
That is, pass the plaintext password followed by what the encrypted version should match. I used your data in the above example.
Regards,
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 06:01 AM
тАО07-07-2009 06:01 AM
Re: decrypt 4 digit passwd.
I though that for some reason this was not working for me, then I realized ( after 1:30 mins thinking) ( I don├В┬┤t even know how to program a "hello world" script ) why the perl scripts where not given me what I needed, they were working fine, I created a password with the pwgen script, and then use the second script to match the plain text the the encrypted password by the perl script. It worked fine :-)
The thing is that HP-UX puts this salt and pepper in my 4 digit password that├В┬┤s the "SP" in the "jaime123SP".
The reason why I was having a hard time myself is because the perl script is not helping me find the corresponding plain text password/matching encrypted cypher because unix uses the makekey command to created the encrypted text and it adds a salt and pepper to the encrypted text, it├В┬┤s just I can not find the match because when using the command:
echo "1234SP" | /usr/lib/makekey
The makekey will add values to it because it├В┬┤s expecting an 8 bit digit plus the SP ( salt and pepper ).
Thanks again for the scripts, it was fun trying to understand them without knowing how to program :-).
If you know how to deal with the above problem, please let me know, I will be a happy man, even more :-)
Thanks James.
Regards,
Jaime.