You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-22Lines changed: 28 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,25 @@
1
1
# Bit Flip Cipher
2
2
3
-
Bit Flip Cipher is a simple encryption tool that encrypts text using a key-derived SHA-256 hash with XOR bit flipping. Since this is a symmetric cipher, decryption is performed using the same key that was used for encryption.
3
+
Bit Flip Cipher is a simple encryption tool that encrypts text using a key-derived SHA-256 hash with XOR bit flipping and gives a Base64 output. Since this is a symmetric cipher, decryption is performed using the same key that was used for encryption.
4
4
This tool was created as a fun project for me to learn more about C and Linux.
5
5
6
-
**Version**: 1.0.0
6
+
**Latest Version**: 1.1.0
7
7
8
-
## How the Cipher Works
8
+
## How the Cipher Works
9
9
10
-
1. The user provides a key (password) for encryption/decryption.
10
+
### Encryption
11
+
1. The user provides a key (password) and the text to be encrypted.
11
12
2. A SHA-256 hash of the key is generated.
12
13
3. Each byte of the input text is XOR-ed with the corresponding byte from the hash (looping through the hash as needed).
13
-
4. The resulting text is the output.
14
-
5. Applying the process again with the same key will decrypt the text.
14
+
4. The resultant is encoded to Base64 to ensure that it is printable.
15
+
5. The Base64 ciphertext is the output.
16
+
17
+
### Decryption
18
+
1. The user provides a key (password) and the Base64 encoded text obtained from encryption.
19
+
2. The Base64 text is decoded back to the original XOR-ed encrypted form.
20
+
3. A SHA-256 hash of the key is generated.
21
+
4. Each byte of the encrypted text is XOR-ed with the corresponding byte from the hash (looping through the hash as needed). This produces the original text, as this process is symmetric.
22
+
5. The resultant plaintext is the output
15
23
16
24
## Installation
17
25
@@ -21,26 +29,22 @@ As of now, a package file is available only for Debian-based distros (Debian, Ub
21
29
22
30
- Download the latest `.deb` package by running this command:
0 commit comments