This repository contains a Python implementation of the SHA-256 encryption algorithm. SHA-256 (Secure Hash Algorithm 256-bit) is one of the cryptographic hash functions designed by the National Security Agency (NSA) and is widely used in various security applications and protocols.
- Python 3.x
-
Clone this repository:
git clone https://github.com/sayantancodex/SHA-256-Encryption-Implementation.git
-
Navigate to the project directory:
cd SHA-256-Encryption-Implementation
-
Run the script with a string input:
python sha256.py "your_message_here"
The sha256.py
script provides an implementation of the SHA-256 hash function. Here's a brief overview of the key components:
- Padding: The input message is padded to ensure its length is a multiple of 512 bits.
- Parsing: The padded message is divided into 512-bit blocks.
- Initial Hash Value: Initial hash values (
h0
toh7
) are set as per the SHA-256 specification. - Message Schedule: For each message block, a message schedule is prepared based on the previous message block.
- Compression Function: The compression function iterates over the message blocks, updating the hash values based on the current block and the message schedule.
This project is licensed under the MIT License.