[Gambas-user] Crypt/Decrypt

Dani Santos jdsantos1978 at ...626...
Thu Jan 19 18:28:01 CET 2006


It depends what do you want the encryption for. If it is for
password-check, the functions provided by the gb.crypt components are
OK.

If you want encrypt / decrypt a text with a given password, there's
nothing implemented in the gambas components (so far I know).

Anyway, if you want to encrypt/decrypt against a MySQL database, look at
the AES_ENCRYPT, AES_DECRYPT functions, or the DES_ENCRYT, DES_DECRYPT
functions of MySQL. 

I've also build a class (based on some VB code I found) that make an
encryption / decryption using the Rynjdael Algorithm. I think is AES
encryption.

After some work, I've got it running with gambas and it's fine for me
but it's quite slow. If you want I send it to you.

Regards.


El jue, 19-01-2006 a las 16:41 +0100, Rohnny Stormo escribió:
> How to crypt and decrypt a string with gambas2.
> 
> I have found md5(password, prefix) as string  and des(password, prefix) 
> as string
> Tried to use it twice but without any luck. If there is not decryption 
> the modules are useless except for MD5 and Check
> When Encrypt/Decrypt are ok, you may save password to local file more secure
> 
> The class should include
> Md5(string) as string
> CheckMD5(md5String) as boolean
> EnCrypt(key, string) as string
> DeCrypt(key, EnCryptString) as string
> 
> Or if it more crypt types can be used it  could be like this
> EnCrypt(key,string, gb.crypt.???) as string
> DeCrypt(key,string, gb.crypt.???) as string
> 
> Example of usage.
> a1b2c3d4e5f6=Encrypt("MyPassword","Hello",gb.crypt.des)
> Hello = DeCrypt("MyPassword","a1b2c3d4e5f6",gb.crypt.des)
> 
> 
-- 
Dani Santos <jdsantos1978 at ...626...>




More information about the User mailing list