c# - MachineKey.Protect and MachineKey.Unprotect -


i'm using .net 4.5 , machinekey.protect/machinekey.unprotect encrypting , decrypting values. i'm wondering when deploy code production we'll have multiple servers, machinekey.protect/machinekey.unprotect works without synchronizing machine keys?

here sample code decrypt:

var bytes = convert.frombase64string(token); var decryvalue = machinekey.unprotect(bytes, purpose); string plaintext = encoding.utf8.getstring(decryvalue); 

let me know thoughts!

to unprotect data you'll need same machine key 1 used protect data. if need unprotect data protected server, servers must share same machine key.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -