https://github.com/abdo-essam/dsa-sha-algorithm
The DSA-SHA algorithm is a cryptographic algorithm used for digital signatures, which is based on the SHA-1 hash function. The program includes methods to convert hexadecimal to binary and vice versa, generate message chunks, left rotate, and hash.
https://github.com/abdo-essam/dsa-sha-algorithm
cryptography digital-signature dsa dsa-algorithm sha1
Last synced: about 1 year ago
JSON representation
The DSA-SHA algorithm is a cryptographic algorithm used for digital signatures, which is based on the SHA-1 hash function. The program includes methods to convert hexadecimal to binary and vice versa, generate message chunks, left rotate, and hash.
- Host: GitHub
- URL: https://github.com/abdo-essam/dsa-sha-algorithm
- Owner: abdo-essam
- Created: 2023-04-22T14:51:58.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-22T15:24:12.000Z (about 3 years ago)
- Last Synced: 2025-01-22T05:41:22.546Z (over 1 year ago)
- Topics: cryptography, digital-signature, dsa, dsa-algorithm, sha1
- Language: Java
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DSA-SHA-algorithm
# Faculty Of Computer And Artificial Intelligence Cairo University `FCAI-CU`
## Cyber Security Assignment
The DSA-SHA algorithm is a cryptographic algorithm used for digital signatures, which is based on the SHA-1 hash function. The program includes methods to convert hexadecimal to binary and vice versa, generate message chunks, left rotate, and hash.
The hextoBin method converts a hexadecimal string input to binary. The binToHex method converts a binary string input to hexadecimal. The generate_chunk method takes a string input and returns an integer array that represents the message chunk used in the SHA-1 hash function. The leftrotate method takes an integer input x and shifts it to the left by shift bits. The hash method takes an integer array input x, extends it into eighty 32-bit words, and returns the SHA-1 hash of the input.
The program also includes some instance variables, such as h1, h2, h3, h4, and h5, which represent the initial values for the five hash variables used in the SHA-1 hash function. The variables k1, k2, k3, and k4 represent the constant values used in the SHA-1 hash function.
Overall, this program can be used to implement the DSA-SHA algorithm for digital signatures in Java.