Someone may have already replied as I am writing this on a plane but generally 
for passwords you do not write a decrypt method for security purposes  (eg you 
do not want people to be able to reverse engineer the encrypted password easily)

You just compare encrypted passwords to see if they are equal.
eg
password:= SecureHashAlgorithm new hashMessage: aClearTextPass.

then later on you check
password = SecureHashAlgorithm new hashMessage: aPasswordAttempt.

On Oct 24, 2011, at 11:44 PM, Mariano Martinez Peck wrote:

> Hi guys. I need to be able to store a password as part of a method. Say I 
> need to be able to do 
> 
> 'thisIsMyPassword' encrypted   -> 'dasdafjewrhjk34wh5435345345345ewfsfs'
> 
> Then I can write the method:
> 
> MyClass >> myPassword
> ^ 'dasdafjewrhjk34wh5435345345345ewfsfs' decrypted
> 
> 
> It should have a kind of public key somehow so that someone cannot easily 
> decrypt it. 
> 
> How can I do that in Pharo? I am totally newbie with all this stuff.
> 
> Thanks,
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com
> 

Reply via email to