Best way to encrypt and decrypt a string?

g_eggidio
Kilo Contributor

Hi to all,
I have an include script that generates a password automatically, I would like to save this value in a field of a custom table, but in encrypted way not visible to users who access the table.
Also I would also need to decrypt it later to send it via email notification.
What is the best way to perform encryption-decryption of an alphanumeric string?

1 ACCEPTED SOLUTION

Archana Reddy2
Tera Guru

Hi,

The below link may help you.

var encr = new GlideEncrypter(); 
var clearString = 'abcdefg'; 
var encrString = encr.encrypt(clearString);
var decrString = encr.decrypt(encrString);  
gs.print("Decrypted string = " + decrString);

LINK

Thanks,

Archana

View solution in original post

5 REPLIES 5

g_eggidio
Kilo Contributor

Perfect. But how can I visualize it with dots or asterisks?