Question

I want to encode passwords for UNIX accounts using the crypt function. I'm using pharo 1.0. I tried to install the crypto package from squeakmap, but it gaves me an error and the package seem to get partially installed (categories without class).

How can I get my password crypted? I'm willing to invoke external code, if it is required (and there's a package in SqueakMap that makes the trick in pharo).

Thanks.

Was it helpful?

Solution

Look if you have a category System-Digital Signatures in your image, with a class SecureHashAlgorithm. You can then hash your password as follows:

(SecureHashAlgorithm new hashMessage: 'my password') asString

OTHER TIPS

In Pharo check the category: System-Hashing.

There you have MD5 and SHA.

Classes: SHA1, MD5NonPrimitive, MD5.

Those classes were extracted from the crypto package from squeaksource, and make them work in Pharo. Then MD5 and SHA were integrated in the core.

Cheers

There is the PasswordHashingFFI package in the Cryptography repository that uses FFI to access the crypt(3) library on linux.

Its here:

http://www.squeaksource.com/Cryptography.html

Use is like

CryptLinuxFFI sha256:'1234'

OSProcess can be used to call any external program. Have a look at http://book.pharo-project.org/book/PharoTools/OSProcess/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top