encryption - encrypting on javascript using ceaser cipher -
My assignment is encrypt and decrypt text only in input and output boxes using Java Script. Everything is already for me but my work is how to write Caesar cipher, can I get an algorithm of a simple one? Thank you.
Most likely you want to apply rot 13 cipher, because this is the same as encryption / decryption Makes algorithms. With it, you raise a character from 13 to get the "encrypted" version. If A1 and Z is 26, then you encrypt, A = & gt; N (1 = & gt; 14) and Z = & gt; M (26 = & gt; 13) Then to decrypt, N = & gt; A (14 = & gt; 1); M = & gt; Z (13 = & gt; 26).
function rot 13 (str) {return (str + '). Replace (/ [az] / gi, function (s) From the return string, the code (S.Corkot at (0) + (STO lowercase) and Lt; 'N' 13: -13))}} ; }
Comments
Post a Comment