xxtea / xxtea-nodejs

XXTEA for encryption algorithm library Node.js
MIT License
57 stars 30 forks source link

Results different with C library #1

Closed iboxgithub closed 8 years ago

iboxgithub commented 8 years ago

Hi,

I am not sure I am expecting the correct output but I give it a try:

Here is my code in JS var k = new Uint32Array([5,0,0,0]); //same behavior with Uint8Array var Master_Key = new Uint32Array([1, 2, 3, 4]); var encrypt_k = xxtea_node.encrypt(k, Master_Key); //gives 'VPQjgwjzD7I='

And attached my code in C

tmp.txt

Knowing that my target is to work like the target points I let in the code (my arrays with int inside are for comparison purpose)

Could you let me know what I do wrong?

Thanks a lot for your help

andot commented 8 years ago

This library is not the original xxtea algorithm. The parameters of xxtea_node.encrypt is bytes(Uint8Array), not Uint32Array. The C version( https://github.com/xxtea/xxtea-c ) is also encript bytes(char *), not uint32_t.