Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nishnash54/twostepencryption
Applying Steganography followed by Visual Cryptography Encode and Decode data
https://github.com/nishnash54/twostepencryption
cryptography python3 steganography visual-cryptography
Last synced: about 1 month ago
JSON representation
Applying Steganography followed by Visual Cryptography Encode and Decode data
- Host: GitHub
- URL: https://github.com/nishnash54/twostepencryption
- Owner: nishnash54
- Created: 2019-11-08T09:55:06.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-22T09:47:34.000Z (about 2 years ago)
- Last Synced: 2023-02-28T11:43:08.881Z (almost 2 years ago)
- Topics: cryptography, python3, steganography, visual-cryptography
- Language: Python
- Size: 3.1 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Two Step Encryption
### Introduction
Applying Steganography followed by Visual Cryptography. Implementation based on the research paper titled **"Combine use of Steganography and Visual Cryptography for Secured Data hiding in Computer Forensics"**Steganography is the method of hiding secret data inside any form of digital media. The main idea behind steganography is to hide the existence of a data in any medium like audio, video, image etc.
Visual cryptography is a cryptographic technique which allows visual information (pictures, text, etc.) to be encrypted in such a way that the decrypted information appears as a visual image.
### Architecture
![image](https://i.imgur.com/nh0J1Sn.png)### Project
##### Structure
```
.
├── images
├── main.py
├── README.md
├── Reference_paper.pdf
├── requirements.txt
└── src
├── lsb_stegno.py
└── n_share.py
```##### File description
| File | Description |
|---------------|-----------------------------------------------------------|
| lsb_stegno.py | Methods to Encode and Decode data using LSB Steganography |
| n_share.py | Methods to Split and Compress LSB Encoded images |### Algorithms
##### Steganography
###### Encoding data in image
```python
# Putting modified pixels in the new image
newimg.putpixel((x, y), pixel)
if (x == w - 1):
x = 0
y += 1
else:
x += 1
```###### Decoding data from image
```python
# string of binary data
binstr = ''for i in pixels[:8]:
if (i % 2 == 0):
binstr += '0'
else:
binstr += '1'data += chr(int(binstr, 2))
if (pixels[-1] % 2 != 0):
return data
```
##### Visual Cryptography
###### Generating shares
```python
# Split image based on random factor
n = int(np.random.randint(data[i, j, k] + 1))
img1[i, j, k] = n
img2[i, j, k] = data[i, j, k] - n
```###### Compressing shares
```python
img[i, j, k] = img1[i, j, k] + img2[i, j, k]
```##### Usage
###### Setup
Install dependencies
```
pip install -r requirements.txt
```
Run using python
```
streamlit run main.py
```