function Encrypt(str) {
if (!str) str = "";
str = (str == "undefined" || str == "null") ? "" : str;
try {
var key = 146;
var pos = 0;
ostr = '';
while (pos < str.length) {
ostr = ostr + String.fromCharCode(str.charCodeAt(pos) ^ key);
pos += 1;
}
return ostr;
} catch (ex) {
return '';
}
}
function Decrypt(str) {
if (!str) str = "";
str = (str == "undefined" || str == "null") ? "" : str;
try {
var key = 146;
var pos = 0;
ostr = '';
while (pos < str.length) {
ostr = ostr + String.fromCharCode(key ^ str.charCodeAt(pos));
pos += 1;
}
return ostr;
} catch (ex) {
return '';
}
}
if (!str) str = "";
str = (str == "undefined" || str == "null") ? "" : str;
try {
var key = 146;
var pos = 0;
ostr = '';
while (pos < str.length) {
ostr = ostr + String.fromCharCode(str.charCodeAt(pos) ^ key);
pos += 1;
}
return ostr;
} catch (ex) {
return '';
}
}
function Decrypt(str) {
if (!str) str = "";
str = (str == "undefined" || str == "null") ? "" : str;
try {
var key = 146;
var pos = 0;
ostr = '';
while (pos < str.length) {
ostr = ostr + String.fromCharCode(key ^ str.charCodeAt(pos));
pos += 1;
}
return ostr;
} catch (ex) {
return '';
}
}
how to do decrypt in c# this code
ReplyDelete