473,698 Members | 2,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pear’s crypt to php

Hi,
I have a set of passwords encrypted using perl’s crypt, from a perl
forum being migrated to php.

I like to bring them into php, and use them without changing them.
How do I emulate perl’s crypt function.

I found a pear module here:
http://pear.php.net/package/Crypt_CB...Crypt_CBC.html
but it seems to only take one argument, whereas perl’s crypt should
take two args (?).

Please help.

steve

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/PHP-pear-cry...ict242528.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=842704
Jul 22 '05 #1
1 3240
steve wrote:
I have a set of passwords encrypted using perl's crypt, from a perl
forum being migrated to php.

I like to bring them into php, and use them without changing them.
How do I emulate perl's crypt function.

I found a pear module here:
http://pear.php.net/package/Crypt_CB...Crypt_CBC.html
but it seems to only take one argument, whereas perl's crypt should
take two args (?).


Using Perl:

my $string = 'the string';
my $salt = 'secret';

print crypt $string, $salt; # Prints sewZw1OY/.llM

Using http://www.php.net/crypt:

$string = 'the string';
$salt = 'secret';

print crypt($string, $salt); # Prints sewZw1OY/.llM
JW

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3692
by: | last post by:
I'm curious how these two functions work together (when crypt() uses a md5 algo). Currently I know they will produce different output; is this due to the salt being used behind-the-scenes in md5()? Is there a way to allow crypt() and md5() to produce identical output or am I misunderstanding the purpose of both the functions. Thanks
8
15209
by: Ryan Lange | last post by:
I've seen md5() suggested a lot when it comes to password encryption, but I'm wondering what the advantage is over using crypt(). Or is it just personal preference? - Ryan
3
5448
by: Marco Herrn | last post by:
I want to use a crypt function to store crypted passwords. These will be used to verify mail-user access. Now the crypt() function from the module crypt is only significant for the first 8 characters. But I need more significant characters. I found the md5 and sha modules. But they work different from the crypt module. But it doesn't seem to be compatible. I need the way crypt works with a salt to verify the password. So my real...
7
2429
by: Bart Nessux | last post by:
Does Python have anything similar to Perl's Crypt::PasswdMD5??? I read about the crypt module... but it only does DES. Any plans to add md5 or other digests to it in the future?
0
2408
by: AdrianK | last post by:
I'm having a lotta problems installing Crypt::RSA on Linux Linux gogol 2.4.17smt-mono using perl5.005_03. Main problem at present is that all the tests fail with Crypt::Primes When I run a trace it looks like a segmentation fault (The same fault I am getting if I force install and run a keygen using Crypt::RSA). Any ideas/help would be appreciated. Crypt::Primes (make test)
0
2765
by: John Bergstrom | last post by:
Hello everyone! I wrote a simple perl program to encrypt a string using Crypt::OpenSSL::RSA. Everything as described in the module documentation. The public key is a valid X.509 encrypted certificate. When I tried executing the code I get the following error: -------------------
0
5665
by: aars | last post by:
Hello all, I am creating a user administration system where system administrator can activate services for a user, like webspace, a mail account or a subdomain. I now want to create a function that creates mysql databases and grant the right privileges to a user. But the problem is that mysql wants to have the plaintext password for the user in the "grant ... identified by 'pwd'" field, or in a manual query to update the password in...
7
5009
by: Kenjis Kaan | last post by:
I would like to use the crypt function in a Win32 (ie. C program using Visual C++ 6.0 compiler). I wrote a little program to see if it will link but it didn't. So I guess maybe the function isn't implement or implemented in a different naming convention. Could someone please help me or show me another method of doing encryption under Win32? TIA
2
3197
by: amygdala | last post by:
Hi, Does anybody now of a custom crypt function that implements sha1? The thing I like about crypt is that I don't have to worry about (re)generating salt when querying the database. Or are there perhaps other functions that implements this same functionality and generates a sha1 hash? Cheers.
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.