I have an encryption logic which is as below, which encrypts and alphabet to alphabet
The input is passed in this (----) place
select chr(mod(ascii(----) - ascii('a') + 541 , ascii('z') - ascii('a')) + ascii('a')) from dual
541 is a seed value based on userid which changes for different logins.
With this (a) and (z) are encrypted to the same value, and hence i am facing problems in decrypting.
can somebody help in changing the above encrption logic.
You really want to use MOD 26 (whereas ASCII z - ASCII a is 25)
SELECT CHR(MOD(ASCII('.') - 97 + 541 , 26) + 97) FROM dual
I guess you realise this only 'encrypts' a single character.
Click Here to Expand Forum to Full Width