LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices



Reply
 
Search this Thread
Old 03-22-2004, 04:29 PM   #1
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Rep: Reputation: 30
Cram-MD5 encryption


Hello,

How do I go about genearating CRAM-MD% encrypted words?

The only utility I've comeup with so far is grub-md5-crypt.

I'd like to believe there are other ways, preferably a way which can be called from a PHP script easily.

Thank you.
 
Old 03-22-2004, 05:14 PM   #2
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 682

Rep: Reputation: 63
You mean something like:
echo test | md5sum
d8e8fca2dc0f896fd7cb4cb0031ba249 -
 
Old 03-29-2004, 11:30 PM   #3
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Original Poster
Rep: Reputation: 30
No I mean something like: (same test password)

$1$pEnEI0$oA.7UVclT6TDNGeWqHuII1
 
Old 04-05-2004, 11:31 PM   #4
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Original Poster
Rep: Reputation: 30
Hey thanks,

But i I foudn out i was tring for the wrong encryption. What i really wanted was BSD style crypt() passwords. Openssl did the job for me.

Thanks
 
Old 04-30-2004, 05:20 AM   #5
merloon
LQ Newbie
 
Registered: Apr 2004
Posts: 1

Rep: Reputation: 0
Hi,

I have the same problem that you and i didn't found the good command whith openssl.
Can you tell me about the command you use ?

Thanks

Merloon
 
Old 04-30-2004, 04:05 PM   #6
pembo13
Member
 
Registered: May 2003
Location: Caribbean
Distribution: Fedora Core2
Posts: 403

Original Poster
Rep: Reputation: 30
To over answer your question, here's the PHP function I came up with to make use of the openssl shell command to do the encryption. Hope it helps:

PHP Code:
function passwd($password,$salt=""){
        if(!
$salt) return exec('openssl passwd -1 "'.$password.'"');
        else{
            
$salt str_replace(" """$salt);
          return 
exec('openssl passwd -1 -salt '.$salt.' "'.$password.'"');
        }

 
  


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
Password Encryption After MD5 Deprecation ombill Fedora 1 08-22-2005 06:16 PM
Kmail error "Unable to Authenticate via. CRAM-MD5" Spreegem Debian 2 08-04-2005 01:50 AM
Postfix cram-md5 authentication to earthlink relay spiritwing Linux - Software 2 07-13-2005 10:19 PM
Newest/Best A+ exam cram book recomendations ? zoso1951 General 2 11-13-2004 03:58 PM
What is MD5 encryption used in Linux? linuxharsha Linux - Security 4 01-13-2004 09:25 PM


All times are GMT -5. The time now is 08:57 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration