C# encryption specific data different output -
i'm looking way of encrypting/decrypting specific value different output every time.
i have list of users , each has userid
guid.
user1: 00838ced-6926-4632-830f-b8f509bec0f5 user2: 7deaac47-fe88-4943-bfde-aac986f65a23 user3: ecbb005f-1e6b-441a-8538-944383d6c0ae ......... usern: 479a344e-364d-4da7-a3f8-99d94301815f
then want able encrypt these guids in such way each time different output. , when decrypt it me userid guid.
any ideas?
add random string end of guid each time encrypt, , strip off , discard when decrypt.
to encrypt:
# add random string end of guid before encrypting encrypted = encrypt(guid + ":" + a_random_string)
to decrypt:
# strip off , discard random string after decrypting. guid = decrypt(encrypted).split(':')[0]
Comments
Post a Comment