Skip to content

Simple tool to encrypt/decrypt using ceasar or vigenere encryption

License

Notifications You must be signed in to change notification settings

Simon946/encryptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

encryptor using vigenere or ceasar

Simple tool to encrypt/decrypt using ceasar or vigenere encryption

Examples

Let's say you have a input.txt file that you want to encrypt using the ceasar cipher.
  1. Choose an ASCII character. This is the key so don't tell anyone else. I choose: 'k'
  2. Think of an filename for the encrypted data. For example: input.txt.encrypted
  3. Now you can encrypt input.txt: ./encryptor ceasar encrypt input.txt input.txt.encrypted k
  4. 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.

Any file type can be used. Note that a larger key file is harder to crack, but this is limited to the input file size.

How does Ceasar encryption work?

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.

How does Vigenere encryption work?

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.

Caution!

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

About

Simple tool to encrypt/decrypt using ceasar or vigenere encryption

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages