How to take data from textarea and decrypt using javascript?

Posted by user1657555 on Stack Overflow See other posts from Stack Overflow or by user1657555
Published on 2012-09-09T02:30:17Z Indexed on 2012/09/09 3:38 UTC
Read the original article Hit count: 181

Filed under:
|

I need to take data from a textarea on a website and decrypt it using a simple algorithm. The data is in the form of numbers separated by a comma. It also needs to read a space as a space. It looks like 42,54,57, ,57,40,57,44. Heres what I have so far:

var my_textarea = $('textarea[name = "words"]').first();
var my_value = $(my_textarea).val();
var my_array = my_value.split(",");

for (i=0; i < my_array.length; i++)
{
var nv = my_array - 124;
var acv = nv + 34;
var my_result = String.fromCharCode(acv);
}

prompt("", my_result);

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about encryption