Skip to content

A Python implementation of Salsa20/12, a stream cipher optimized for high-speed encryption & decryption. Uses bitwise XOR operations, quarter-round transformations, and key expansion algorithms for lightweight but secure cryptographic processing. Supports 128/256-bit key lengths for secure data transmission.

Notifications You must be signed in to change notification settings

SiddarthaBoreddy/salsa20-encryption-implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Salsa20/12 Encryption Algorithm Implementation

๐Ÿ“– Overview

This project implements the Salsa20/12 encryption algorithm, a lightweight and secure stream cipher used for encrypting data. The algorithm is a variant of Salsa20, designed for fast and efficient encryption while maintaining strong security properties.

The provided Python script (salsa2012.py) contains the implementation of quarter rounds, row rounds, and column rounds, which form the core of the Salsa20/12 encryption function.


๐Ÿ›  Technologies Used

  • Python โ€“ Core implementation language.
  • NumPy โ€“ Optimized numerical computations for encryption operations.
  • Struct & Bitwise Operations โ€“ Used for efficient data transformations.

๐Ÿ“Œ Features

โœ… Implements Salsa20/12 Encryption Algorithm
โœ… Fast and Secure Stream Cipher
โœ… Lightweight & Efficient for Data Encryption
โœ… Python-Based Implementation
โœ… Supports 128-bit and 256-bit Encryption Keys


๐Ÿ“‚ Project Structure

๐Ÿ“ Salsa20-Encryption/
โ”‚โ”€โ”€ salsa2012.py     # Python script implementing Salsa20/12 encryption
โ”‚โ”€โ”€ README.md        # Project documentation

๐Ÿš€ How It Works

1๏ธโƒฃ Initialize the Salsa20/12 state
2๏ธโƒฃ Perform quarter-round transformations
3๏ธโƒฃ Apply row and column rounds for mixing data
4๏ธโƒฃ Generate keystream for encrypting plaintext
5๏ธโƒฃ Encrypt or decrypt data using XOR with keystream


๐Ÿƒ Running the Encryption Script

Encrypting Data

python salsa2012.py --encrypt --input plaintext.txt --output encrypted.bin --key "your-secret-key"

Decrypting Data

python salsa2012.py --decrypt --input encrypted.bin --output decrypted.txt --key "your-secret-key"

This will securely encrypt and decrypt data using Salsa20/12.


๐Ÿ” Security Considerations

  • Salsa20/12 is resistant to known cryptanalysis attacks.
  • The 12-round variant is a trade-off between speed and security.
  • Always use a unique nonce to prevent repetition in encryption.

๐Ÿ”ฎ Future Enhancements

๐Ÿ”น Expand to Full Salsa20 Implementation (20 Rounds)
๐Ÿ”น Integrate ChaCha20 Encryption
๐Ÿ”น Support for File Encryption & Secure Key Management
๐Ÿ”น Performance Optimizations for Large Data Sets


๐Ÿ“œ References


๐Ÿ“ง Contact

Author: Siddartha Reddy Boreddy
๐Ÿ“ SUNY Binghamton
โœ‰๏ธ Email: sboreddy@binghamton.edu


โญ If you find this project helpful, feel free to star the repository! ๐Ÿš€

About

A Python implementation of Salsa20/12, a stream cipher optimized for high-speed encryption & decryption. Uses bitwise XOR operations, quarter-round transformations, and key expansion algorithms for lightweight but secure cryptographic processing. Supports 128/256-bit key lengths for secure data transmission.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages