Simple tool to encrypt/decrypt using ceasar or vigenere encryption
Let's say you have a input.txt file that you want to encrypt using the ceasar cipher.- Choose an ASCII character. This is the key so don't tell anyone else. I choose: 'k'
- Think of an filename for the encrypted data. For example: input.txt.encrypted
- Now you can encrypt input.txt:
./encryptor ceasar encrypt input.txt input.txt.encrypted k
- To decrypt the file:
./encryptor ceasar decrypt input.txt.encrypted decrypted.txt k
This uses 'k' as the key. You can use any ASCII character as the key.
You can do something similar using the vigenere cipher:
./encryptor vigenere decrypt encrypted.docx plain.docx keyfile.mp4
But this time, choose a file as the key instead of a single ASCII character. Make sure that this file is kept secret.
Alongside a file, you could also use any integer value between 0 and 2^64-1.
With Ceasar encryption, you go byte per byte over the input file. For every byte, you add the value of the key. To decrypt, you subtract the key from the encrypted file. This type of encryption is very easy to crack, because there can only be 256 different keys and each byte is encoded with the same key.
Vigenere is comparable with the Ceasar encryption, except that the key changes for every byte. Instead of applying one key to all the bytes, a keyfile is used where the bytes in the file are used for encryption and decryption. The first byte in the input is encrypted with the first byte of the keyfile, the second byte in the input is encrypted with the second byte of the keyfile and so on. When the input file is larger than the keyfile, the keyfile is repeated. This reduces safety because it means that some bytes are encrypted with the same values at a fixed distance. To solve this, the key file should be the same size or longer than the input file.
This software probably has bugs and security flaws. It is not save to use this software to encrypt sensitive data. I am not responsible for any damages done by the software in this repository