encryption and decryption of spl chars
I have a string of Special characters.
I need to encrypt each of the special character to another value in the string, without repeatation, so that i can decrypt it back, for a particular seed value.
substr(string_val, mod (instr(string_val,curr_char) + 545,length(string_val)),1)
Curr_char is the value passed to get the encrypted one.
I am getting repeations (for eg., * and , are getting encrypted to $) due to which i am not able to decrypt.
can somebody suggest changes to the above query, so that there wont be any repeatations.
Re: encryption and decryption of spl chars
Why don't you just use the Obfuscation Toolkit?
this space intentionally left blank
Due to some bottlenecks in the application, i cannot use it.
I want a common algorith, which works same in front end and back end.
Your problem is that MOD( , n) gives values from 0 to n-1 and SUBSTR(x, 0, 1) is interpreted as SUSBTR(x, 1, 1). Check with this
P.S. mod(545,16)=1 why be so complicated?
string_val varchar(30) := '$%&()~''*,-/:;=?_';
for i in 1..length(string_val) loop
curr_char := substr(string_val, i, 1);
out_line := curr_char||' gives '||
substr(string_val, mod (instr(string_val,curr_char) + 545,length(string_val))+1,1);
Last edited by DaPi; 05-05-2005 at 07:18 PM.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Click Here to Expand Forum to Full Width