Re: [go-nuts] GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Christian Staffa
Hi I guess the problem is the range over the input. if you have utf8 runes > 1byte in your input, you are not iterating with over each byte anymore. the i is the index of a encoded rune the string., right? Sent from my iPhone > On 19. Jan 2019, at 13:53, Soorya Prakash wrote: > > > I am using

Re: [go-nuts] GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Jan Mercl
On Sun, Jan 20, 2019 at 4:13 PM Soorya Prakash wrote: > for i := range input { > output += string(input[i] ^ key[i%len(key)]) > } BTW, that's O(n^2). -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this g

[go-nuts] GO lang not able to decrypt the xor-base64 text

2019-01-20 Thread Soorya Prakash
I am using the below code to encrypt and decrypt the data. Now I want to encrypt the data from Node JS and want to decrypt the data from Go lang. But I am not able to achieve it using GO lang. var B64XorCipher = { encode: function(key, data) { return new Buffer(xorStrings(key, data),'utf8