My JavaScript is weak-sauce, but here's the gist (cobbled together from the Internets): https://gist.github.com/a110621fe731facb40ff
The newLisp encrypt response looks like this:
Code: Select all
> (setf text_enc (encrypt "My name is Earl." "foobar")
"+\022O\012\000\031\003O\006\017A7\007\029\003L"))
Code: Select all
> (encrypt("My name is Earl.", "foobar")
043022079012000031003079006017065055007029003076
Code: Select all
> (unpack (dup "c" (length str)) str)
(43 22 79 12 0 31 3 79 6 17 65 55 7 29 3 76)
If I force everything to be properly formatted for JavaScript, it all works out...
Code: Select all
(join (map (fn (x) (format "%03d" x)) (unpack (dup "c" (length text_enc)) text_enc)) )
> "043022079012000031003079006017065055007029003076"
Code: Select all
> (join (map (fn (x) (pack (dup "c" 3) x)) (explode js_text 3)))
"Ѐ?0?\000\016 0@P`p???"
Anyone?
P.S. Why doesn't newLisp have SHA256 or AES again? :(