Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all articles
Browse latest Browse all 3862

Answered: XtsStream encryption key

$
0
0

It seems that you need rather low level of the XTS-AES implementation instead of XtsStream, which is high-level API.

I have made our internal XTS-AES implementation public, so you can use it now like this:

using (var xts = new Rebex.Security.Cryptography.Xts(encryptionKey, tweakingKey))
{
    Console.WriteLine(BitConverter.ToString(plaintext));

    xts.EncryptSector(tweak, plaintext, 0, plaintext.Length, encrypted, 0);

    Console.WriteLine(BitConverter.ToString(encrypted));

    xts.DecryptSector(tweak, encrypted, 0, encrypted.Length, plaintext, 0);

    Console.WriteLine(BitConverter.ToString(plaintext));
}

Please note, that if you want to encrypt (or decrypt) data using more EncryptSector calls, the input sector (data length) should be multiple of the Xts.BlockSize (currently 16 bytes).

Also please note, that the single sector (input for the EncryptSector method) has to be at least Xts.BlockSize bytes long (currently at least 16 bytes).

You can download trial version here.

If you need other platform build or you want to receive full version, please let us know at support@rebex.net.


Viewing all articles
Browse latest Browse all 3862

Trending Articles