Open Valduis4 opened 2 years ago
Sorry for the late reply. Salsa's IV must be 8 bytes long, but you are using only 4 bytes for it, so you have Undefined Behavior in your code.
As a side note: this repo is really-really old, but there is a type-safe C++20 implementation of the Salsa stream cypher: https://github.com/everard/libecstk-crypto/blob/master/src/crypto_stream_salsa.hh https://github.com/everard/libecstk-buffer/blob/master/src/buffer.hh
I am trying to decrypt the encryption but it keeps encrypting further. Is there something I am missing? `string sKey = "help"; string siv = "test"; uint8_t key =(uint8_t ) sKey.c_str(); uint8_t iv =(uint8_t ) siv.c_str(); ucstk::Salsa20 salsa20(key); salsa20.setIv(iv);
Output : )┴à┴
`string sKey = "help"; string siv = "test"; uint8_t key =(uint8_t ) sKey.c_str(); uint8_t iv =(uint8_t ) siv.c_str(); ucstk::Salsa20 salsa20(key); salsa20.setIv(iv);
` Output: hF}♣╔┤‼0o