Skip to content

Encrypting videos using Space-Filling Curves πŸ‘¨πŸΏβ€πŸ’»

Notifications You must be signed in to change notification settings

ab-anand/Video-Encryption

Repository files navigation

Video Encryption using Space Filling Curves

Python 3x

This project is aimed to implement an algorithm to prevent the Chosen Plain Text Attack on Space Filling Curves. With the help of that algorithm we would be encrypting videos using Selective Frame Encryption.

Project Tree

Video-Encryption/
	β”œβ”€β”€ bin
	β”‚Β Β  β”œβ”€β”€ setup
	β”‚Β Β  └── setup.sh
	β”œβ”€β”€ capture_frames.py
	β”œβ”€β”€ decrypt.py
	β”œβ”€β”€ encrypt.py
	β”œβ”€β”€ frame_editor.py
	β”œβ”€β”€ frames
	β”‚Β Β  β”œβ”€β”€ frame0.jpg
	β”‚Β Β  β”œβ”€β”€ frame_dec.jpg
	β”‚Β Β  β”œβ”€β”€ frame_enc_2.jpg
	β”‚Β Β  β”œβ”€β”€ frame_enc_9.jpg
	β”‚Β Β  └── frame_enc.jpg
	β”œβ”€β”€ hilbertt.py
	β”œβ”€β”€ img.jpg
	β”œβ”€β”€ input2.avi
	β”œβ”€β”€ input2.mp4
	β”œβ”€β”€ inverted_pixels.json
	β”œβ”€β”€ metrics
	β”‚Β Β  β”œβ”€β”€ correlation.py
	β”‚Β Β  β”œβ”€β”€ entropy.py
	β”‚Β Β  β”œβ”€β”€ hist.py
	β”‚Β Β  β”œβ”€β”€ ncc2.py
	β”‚Β Β  β”œβ”€β”€ plot_cor.py
	β”‚Β Β  β”œβ”€β”€ psnr.py
	β”‚Β Β  └── ssim.py
	β”œβ”€β”€ multiprocessing
	β”‚Β Β  β”œβ”€β”€ mulitprocessing.py
	β”‚Β Β  └── pooling.py
	β”œβ”€β”€ output.avi
	β”œβ”€β”€ output_dec.avi
	β”œβ”€β”€ pixels.json
	β”œβ”€β”€ playback.mp4
	β”œβ”€β”€ playout.avi
	β”œβ”€β”€ README.md
	β”œβ”€β”€ requirements.txt
	β”œβ”€β”€ resize_frame.py
	β”œβ”€β”€ reverse_pixels.py
	β”œβ”€β”€ SETUP.md
	β”œβ”€β”€ swap.py
	└── video_dec.py

Project Files

  • capture_frames.py
    • This files uses OpenCV and other tools to capture a particular frame.
    • It takes the location of the video through commandline arguments.
    • It then capture frames at every 6 seconds interval.
    • Output frames are then saved in the Frames folder.
    • The code has been provided with relevant comments for further information.

Milestones of the Project

  • Capturing Frames
    • Getting particular frames from a given video.
  • Strategy for selecting frames
    • Deciding algorithm for selecting frames for Selective Frame Encryption.
  • Scrambling the frames
    • Using SFCs to encrypt the acquired frame.
  • Putting back the Frames
    • Pushing the scrambled frames back in the output video.
  • Decrypting it back
    • Converting the scrambled frames back to original frame and create the output video.

Setup

Visit the Setup file