Search code examples
securityencryptioncryptographyencryption-symmetric

Can One-Time-Pad key be reused if encrypted plaintext is random?


I want to encrypt purely random data with one single key that is shorter than the plaintext.

Should I use AES or another robust encryption algorithm, or can I use OTP, i.e. only xoring (purely random) plaintext with the unique key, block by block?

E.g. data is 1024 bits long and is random. Key is 128-bit long (random too). Is it safe to encrypt data by xoring 8 successive 128-bit blocks with the same key?


Solution

  • E.g. data is 1024 bits long and is random. Key is 128-bit long (random too). Is it safe to encrypt data by xoring 8 successive 128-bit blocks with the same key?

    If your data is random, then the answer is yes.

    You can consider your actual data as OTP key here. It's purely random and is used only once, so there's no way to recover either key or data.