Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

emulate PHP "crypt" function in c#?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JamesB - 05 Mar 2008 09:26 GMT
Not sure if this is possible, but has anyone seen (or know how to do)
emulation of the PHP "crypt" function from within c#?

Thanks
Jon Skeet [C# MVP] - 05 Mar 2008 10:01 GMT
> Not sure if this is possible, but has anyone seen (or know how to do)
> emulation of the PHP "crypt" function from within c#?

Are you just trying to do cryptography in general, or does it have to
match the exact format/functionality of PHP's "crypt" function?

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

JamesB - 05 Mar 2008 21:53 GMT
>> Not sure if this is possible, but has anyone seen (or know how to do)
>> emulation of the PHP "crypt" function from within c#?
>
> Are you just trying to do cryptography in general, or does it have to
> match the exact format/functionality of PHP's "crypt" function?

Ideally I want to be able to "crypt" a string in a c# app, and get the same
hash that a bit of php code on a webserver would generate... I'll have a
play with the built in .net stuff and see what comes out I guess...
Thanks
Jon Skeet [C# MVP] - 05 Mar 2008 22:08 GMT
> >> Not sure if this is possible, but has anyone seen (or know how to do)
> >> emulation of the PHP "crypt" function from within c#?
[quoted text clipped - 5 lines]
> hash that a bit of php code on a webserver would generate... I'll have a
> play with the built in .net stuff and see what comes out I guess...

Unfortunately it looks like that could vary significantly:

http://articles.techrepublic.com.com/5100-22-1058691.html
http://www.w3schools.com/php/func_string_crypt.asp

If you can work out exactly which one you want to support, the rest is
probably easy :)

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

rossum - 05 Mar 2008 10:03 GMT
>Not sure if this is possible, but has anyone seen (or know how to do)
>emulation of the PHP "crypt" function from within c#?
>
>Thanks
According to http://www.phpbuilder.com/manual/en/function.crypt.php
the PHP cryp() function may use either DES or MD5.  Both of these are
available in .NET

rossum
Roger Frost - 05 Mar 2008 14:00 GMT
>>Not sure if this is possible, but has anyone seen (or know how to do)
>>emulation of the PHP "crypt" function from within c#?
[quoted text clipped - 5 lines]
>
> rossum

There is also such a thing as a PHP .NET complier.  In a pinch you could
incorporate it that way, but I'm not sure what other PHP runtime components
are required.

See http://www.php-compiler.net/doku.php

Signature

Roger Frost
"Logic Is Syntax Independent"


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.