IBM Support

How to encrypt text using ASCII Encryption?

Question & Answer


Question

How to encrypt text using ASCII Encryption?

Answer

Below is the custom javascript which uses a encryption method that uses random values for each character. You can encrypt the same string as many times as you want and the result will always be different.

function Encrypt(inStr) {
output = new String;
Temp = new Array();
Temp2 = new Array();
TextSize = inStr.length;
for (i = 0; i < TextSize; i++) {
rnd = Math.round(Math.random() * 122) + 68;
Temp[i] = inStr.charCodeAt(i) + rnd;
Temp2[i] = rnd;
}
for (i = 0; i < TextSize; i++) {
output += String.fromCharCode(Temp[i], Temp2[i]);
}
return output;
}

[{"Product":{"code":"SSGR73","label":"IBM Cast Iron Cloud Integration"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"PF033","label":"Windows"}],"Version":"5.0.1.6;5.0.1.8;6.1.0.10;6.1.0.12;6.1.0.9","Edition":"Virtual;Physical;Cloud","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

00000478

Product Synonym

Cast Iron Solution;Cast Iron Operating System;Cast Iron Studio

Document Information

Modified date:
15 June 2018

UID

swg21453152