All Projects → NITDgpOS → SecureSnaps

NITDgpOS / SecureSnaps

Licence: MIT license
Image Codec using Private-key cryptography

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to SecureSnaps

Prnet
Joint 3D Face Reconstruction and Dense Alignment with Position Map Regression Network (ECCV 2018)
Stars: ✭ 4,479 (+34353.85%)
Mutual labels:  swap
Straks
A new decentralised, open source, community driven digital currency, focusing on e-commerce utility
Stars: ✭ 53 (+307.69%)
Mutual labels:  swap
rasn
A Safe #[no_std] ASN.1 Codec Framework
Stars: ✭ 131 (+907.69%)
Mutual labels:  codec
Heim
Cross-platform async library for system information fetching 🦀
Stars: ✭ 572 (+4300%)
Mutual labels:  swap
Understanding Financial Reports Using Natural Language Processing
Investigate how mutual funds leverage credit derivatives by studying their routine filings to the SEC using NLP techniques 📈🤑
Stars: ✭ 36 (+176.92%)
Mutual labels:  swap
Multicurrencywallet
Bitcoin, Ethereum, ERC20 crypto wallets with Atomic Swap exchange. Release announce: https://twitter.com/SwapOnlineTeam/status/1321844352369500160
Stars: ✭ 136 (+946.15%)
Mutual labels:  swap
Rotatable
Helper class to make any view rotatable
Stars: ✭ 295 (+2169.23%)
Mutual labels:  swap
proxmox toolbox
A toolbox to get the firsts configurations of Proxmox VE / BS done in no time
Stars: ✭ 158 (+1115.38%)
Mutual labels:  swap
Btrfs Swapon
Btrfs doesn't allow to swap on a file. This script allows you do swap on a file anyway.
Stars: ✭ 42 (+223.08%)
Mutual labels:  swap
av1parser
AV1 video codec bitstream parser (not decoder!)
Stars: ✭ 27 (+107.69%)
Mutual labels:  codec
Faceswap
Real-time FaceSwap application built with OpenCV and dlib
Stars: ✭ 611 (+4600%)
Mutual labels:  swap
Eda nlp
Data augmentation for NLP, presented at EMNLP 2019
Stars: ✭ 902 (+6838.46%)
Mutual labels:  swap
Swap
Simple swap setup script for Linux.
Stars: ✭ 143 (+1000%)
Mutual labels:  swap
Systemd Swap
Script for creating hybrid swap space from zram swaps, swap files and swap partitions.
Stars: ✭ 473 (+3538.46%)
Mutual labels:  swap
img-cryptor
Image AES256 crypt-decrypt
Stars: ✭ 37 (+184.62%)
Mutual labels:  aes-encryption
Jetstrap
A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel Jetstream and Breeze to Bootstrap 4.
Stars: ✭ 320 (+2361.54%)
Mutual labels:  swap
Face Swap Android
Realtime Face Swap Android NDK app full source code. Developed with OpenCV (http://opencv.org) and Dlib C++ (http://dlib.net).
Stars: ✭ 111 (+753.85%)
Mutual labels:  swap
nft-swap-sdk
Ethereum's missing p2p NFT and token swap library for web3 developers. Written in TypeScript. Powered by 0x.
Stars: ✭ 200 (+1438.46%)
Mutual labels:  swap
mbedcrypto
a portable, small, easy to use and fast c++14 library for cryptography.
Stars: ✭ 38 (+192.31%)
Mutual labels:  aes-encryption
Cssjanus
↔️ Convert CSS stylesheets between left-to-right and right-to-left.              Made by Wikimedia.
Stars: ✭ 168 (+1192.31%)
Mutual labels:  swap

SecureSnaps

Join the chat at https://gitter.im/SecureSnaps55/Lobby forthebadge

Image encryption and Decryption based on private-key cryptography

Algorithm Description

  • Step 1: User enters a password: password
  • Step 2: The password is encoded in utf-8 followed by generating a sha256 hash
  • Step 3: The sha256 hash is converted to hex
  • Step 4: This hex values are used to generate an array of integer values
  • Step 5: The array is divided into four key tuples, each containing 4 integers.
  • Step 6: Each key tuple is used to encode/ decode the image. The number of times, the recursive encryption/decryption takes place for a key tuple is called the degree of the key tuple.
  • Step 7: Using the key tuples, the color is also encoded using a XOR cipher

Encryption using Key tuples

Let's say we have a key tuple [a, b, c, d] , codec function f(x) and degree = n

ith degree Key tuple Process
0 [a, b, c, d] nothing
1 [f(a), f(b), f(c), f(d)] Swap Pixel f(a),f(b) with Pixel f(c),f(d)
2 [f(f(a)), f(f(b)), f(f(c)), f(f(d))] Swap Pixel f(f(a)),f(f(b)) with Pixel f(f(c)),f(f(d))
... ... ...
n [fn(a), fn(b), fn(c), fn(d)] Swap pixel Pixel fn(a),fn(b) with Pixel fn(c),fn(d)

Note: Decryption algorithm is simply the reversal of Encryption process.

Color encryption using XOR

  • Extract 3 values from a key tuple [a, b, c]

  • A single pixel consists of three values - (RED, GREEN, BLUE)

  • Here, we use XOR logical operation between each pixel parameter and key tuple value

    • NEW_RED = RED ^ a

    • NEW_GREEN = GREEN ^ b

    • NEW_BLUE = BLUE ^ c, where ^ is XOR

  • We replace the old pixel with the newly formed pixel (NEW_RED, NEW_GREEN, NEW_BLUE)

  • XOR has a special property which enables us to trace back the original pixel values without loss of data

    • a^b = c

    • c^b = a

  • Here, let a be the pixel parameter and b be the key tuple value. On XORing it, we obtain c and we store it.

  • For decryption, XORing c with key tuple value b will give us the original pixel value a.

  • Each pixel value ranges from 0 to 255. Hence the modulus of 256 is applied over final results after XORing.

Documentation

keygen.py

  • max_val(ht,wdth) : returns max(ht,wdth)
  • get_string_hash() : returns the hashvalue for the entered password
  • generate_tuples(H,W) : generates a list of tuples recursively for the codec
  • yield_chunks(block, iterate_size) : returns lists of varying size for the hash list

encoder.py

Encodes the image at image_path as per the entered password

decoder.py

Decodes the image at image_path as per the entered password

utils.py

  • fucntion(x) : The first function for generating tuples
  • function2(x): The second function for generating tuples
  • swap(ai,aj,bi,bj, image, arr) : swaps two pixels arr(ai,aj) with arr(bi, bj)
  • efficiency(orig, enco, W, H) : Finds the efficiency of the encryption by comparing the original image with encoded image, W and H are width ad height respectively
  • cascade(xy, N, W, H) : creates a recursively cascaded list (of length N) of tuples
  • automate_swap(alpha, beta, N, image, arr) : swaps pixels automatically for encryption
  • automate_swap_dec(alpha, beta, N, image, arr) : swaps pixels automatically for decryption
  • color(arr, val, W, H) : Encrypts the color of each pixel against key tuple using XOR operation

Installation and Usage

git clone https://github.com/NITDgpOS/SecureSnaps.git
cd SecureSnaps
sudo bash install
  • To encode: ssnaps -e <image_path>
  • To decode: ssnaps -d <image_path>

Check the Contribution Guidelines here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].