[EU, Client] Cryptography

10/23/2017 12:32 BlowaXD#16
Quote:
Originally Posted by -Nokis View Post
The NosTale Client uses the Windows-1252 encoding. You have to encode ‘current_packet’ in win1252.
It's not a need.
10/23/2017 17:20 WalrossGreat#17
It is if you want properly encode/decode special characters like łśćń etc, however it's not always the win1252, it depends on your local 8 bit, eg it may be win1250
10/23/2017 21:23 Bejine#18
it depends on the client, some countries use 1250 (poland), others use 1252 (germany, i think)
11/05/2017 22:44 lika85#19
Ty guys :handsdown:, now getting packets works, but sending packet is buggy, what should i do to send right encoded packet? Better question is, what is the server encoding? :)
11/22/2017 11:19 Cryless~#20
Quote:
Originally Posted by lika85 View Post
Ty guys :handsdown:, now getting packets works, but sending packet is buggy, what should i do to send right encoded packet? Better question is, what is the server encoding? :)
Had you found an answer to your question? Let us know about your experience it might help someone else.
11/22/2017 21:43 lika85#21
Well i fount, that the right encoding for czech server is Latin 1, probably for other servers too, i am encoding the output of decryptGamePacket function, but sending chars from Latin 1 is still not working :(. I tried encode the input to encrypt function, the output too, with different encodings (latin 1,cp1250,cp1252), but the result on nostale server is "?" or space, sometimes when i write character from Latin 1, it cuts the packet, so if i send "say abcčd" i see "abc", but sometimes it is "abc?d" or "abc d"
12/05/2017 00:59 -Nokis#22
Quote:
Originally Posted by lika85 View Post
Well i fount, that the right encoding for czech server is Latin 1, probably for other servers too, i am encoding the output of decryptGamePacket function, but sending chars from Latin 1 is still not working :(. I tried encode the input to encrypt function, the output too, with different encodings (latin 1,cp1250,cp1252), but the result on nostale server is "?" or space, sometimes when i write character from Latin 1, it cuts the packet, so if i send "say abcčd" i see "abc", but sometimes it is "abc?d" or "abc d"
The correct encoding for Czech is Windows-1250.
I think there's a problem with your encryption algorithm.

I suggest to use the C++ crypto for testing: pass a random string to the C++ encryption, compile it, do the same with your Java algorithm and check if the output is the same (encoding here doesn't matter, compare bytes from buffers). If not, compare step by step your algorithm with the C++ one.
12/05/2017 19:54 lika85#23
Quote:
Originally Posted by -Nokis View Post
The correct encoding for Czech is Windows-1250.
I think there's a problem with your encryption algorithm.

I suggest to use the C++ crypto for testing: pass a random string to the C++ encryption, compile it, do the same with your Java algorithm and check if the output is the same (encoding here doesn't matter, compare bytes from buffers). If not, compare step by step your algorithm with the C++ one.
I've solved my problem. I was really dumb :D. I converted the buf string into byte array with the coding, and then converted the byte array to string. In java String has only UTF16 internlal coding. So it is working :cool:.
03/15/2018 13:18 siuwing123#24
after i include the cryptoPP library and compile.
#error <mutex> is not supported when compiling with /clr or /clr:pure.