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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -