Follow

I know nothing about encryption/decryption

I could use some help with this function in libsodium

crypto_stream_chacha20_xor

the documentation says:

"The function encrypts the message _m_ ...

The cyphertext is put into _c_"

A few lines later:

"_m_ and _c_ can point to the same address (in-place encryption/decryption)"

So it can encypt AND decrypt ?

Maybe the key is this one:

"The ciphertext is the message combined with the output of the stream cipher using the XOR operation"

I'm not sure what combining the message and the stream (?) with xor exactly means

I should probably try to encrypt a string and then pass it again through the function and see what it gets me back ?

@abbienormal
if you apply xor to two bytes A and B
and gives you the result C, you can recover A by applying xor between B and C

xor:
1^1=0
1^0=1
0^1=0
0^0=1

message^password=chiper
password^chiper=message

also message^chiper=password !!!

@herrero_maty

thank you, I appreciate this

In the meantime I have found the bit that does the encription (I was looking at the one doing the DEcryption) and it uses the same crypto_stream_chacha20_xor, I think

Sign in to participate in the conversation
FLOSS.social

For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).