Skip to content

Demonstration of OTP technology to encrypt an image.

Notifications You must be signed in to change notification settings

QryptInc/otp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

otp-demo

Demonstration of OTP technology to encrypt an image.

Setup instructions

Log in to your personal GitHub account. Click the <> Code dropdown on GitHub and select Create codespace on main. This will create a new codespace, which is a sandbox with everything you need to complete this workshop. Please allow up to 4 minutes for the codespace to set up the environment. Note if codespaces is not spinning up, please try a different browser (we have tested it with Firefox).

Part 1

We will encrypt the image using AES ECB mode to demonstrate the shortcomings of classical cryptography.

Boilerplate code is provided in this repository. Please fill out encryptAES256ECB function in encrypt.cpp. In addition, fill out the main function in main.cpp so that the application can encrypt the image contents using AES ECB mode. You may optionally fill out decryptAES256ECB function in encrypt.cpp to support decryption if you have time.

Follow the build steps at the end of this README to build the application. We have provided a sample input image and AES key (32 bytes) to test this part. Execute the following command from the build directory.

./otp-demo encrypt --input-filename=../files/tux.bmp --key-filename=../files/aes.dat --output-filename=../files/encrypted_tux.bmp

References

Part 2

We will encrypt the image using OTP to demonstrate the improvement over classical cryptography.

Boilerplate code is provided in this repository. Please fill out xorVectors function and the main function in main.cpp so that the application can encrypt the image contents using the OTP.

Again, follow the build steps at the end of this README to build the application. We have provided a sample input image and OTP (196608 bytes) to test this part. Execute the following command from the build directory.

./otp-demo encrypt --input-filename=../files/tux.bmp --key-filename=../files/otp.dat --output-filename=../files/encrypted_tux.bmp

Build Steps

  1. Open a terminal in VSCode
  2. Create a build directory
    mkdir build && cd build
    
  3. Build using cmake
    cmake ..
    cmake --build .
    

About

Demonstration of OTP technology to encrypt an image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published