Text or images on a computer are expressed as numbers. See the Data EnCoding page.
Asymmetric encryption is poorly suited for encrypting data larger than the modulus.
| File blocks | * | 123 | 234 | 345 | ... | 567 | ... | 789 |
|---|---|---|---|---|---|---|---|---|
| Encryption key | 210 | +210+537 | +210+870 | +210+1314 | +210+2535 | +210+4200 | ||
| Encrypted blocks | 537 | 870 | 1314 | 1869 | 3312 | 5199 |
The first block of ciphertext contains nonsense that is used to derive the key for the next block.
| Encrypted blocks | 537 | 870 | 1314 | 1869 | ... | 3312 | ... | 5199 |
|---|---|---|---|---|---|---|---|---|
| Encryption key | 210 | -210-537 | -210-870 | -210-1314 | -210-2535 | -210-4200 | ||
| File blocks | 123 | 234 | 345 | 567 | 789 |
In reality, addition and subtraction operations are not used. The form below uses an algorithm that hashes the concatenation of the key and the previous ciphertext block. The source text block is added to the hash sum using the XOR operation. But Feistel cipher are often used in block encryption algorithms.
The initialization vector will be written unchanged as the first block of ciphertext.
For file transfer, it is more practical to use encrypted ZIP files. When working on the command line (cmd.exe), you can use the -e or -P arguments for encryption. See the help (man).