Skip to content

Commit a337889

Browse files
committed
Added new files and folders, edited existing files
1 parent cf601b4 commit a337889

File tree

11 files changed

+206
-0
lines changed

11 files changed

+206
-0
lines changed

Caesar Cipher/Ency_Decy.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Caesar Cipher Encryption/Decryption
2+
def encrypt(text, shift):
3+
result = ''
4+
for char in text:
5+
if char.isalpha():
6+
base = ord('A') if char.isupper() else ord('a')
7+
result += chr((ord(char) - base + shift) % 26 + base)
8+
else:
9+
result += char # Keep spaces/symbols as is
10+
return result
11+
12+
def decrypt(text, shift):
13+
return encrypt(text, -shift)
14+
15+
def main():
16+
choice = input("Type 'encrypt' or 'decrypt': ").strip().lower()
17+
18+
if choice not in ['encrypt', 'decrypt']:
19+
print("Invalid choice. Please type 'encrypt' or 'decrypt'.")
20+
return
21+
22+
message = input("Enter your message: ")
23+
24+
try:
25+
shift = int(input("Enter shift value (0-25): ")) % 26
26+
except ValueError:
27+
print("Shift must be a number.")
28+
return
29+
30+
if choice == 'encrypt':
31+
print("Encrypted message:", encrypt(message, shift))
32+
else:
33+
print("Decrypted message:", decrypt(message, shift))
34+
35+
if __name__ == '__main__':
36+
main()

Caesar Cipher/README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# 🛡️ Caesar Cipher Tool
2+
3+
A command-line utility to **encrypt** and **decrypt** messages using the Caesar Cipher algorithm. Great for learning basic cryptography, creating puzzles, or encoding secret messages within a local or collaborative environment.
4+
5+
---
6+
7+
## 🔐 What is Caesar Cipher?
8+
9+
Caesar Cipher is a substitution cipher where each letter in the plaintext is shifted by a fixed number (shift key) of positions down the alphabet.
10+
11+
### Example (Shift = 3):
12+
- A → D
13+
- B → E
14+
- X → A
15+
- Z → C
16+
17+
> **Encryption**: Shift letters forward
18+
> **Decryption**: Shift letters backward
19+
20+
---
21+
22+
## 📦 Features
23+
24+
- Encrypt or decrypt any string using a simple shift
25+
- Supports both uppercase and lowercase
26+
- Leaves spaces, numbers, and punctuation unchanged
27+
- Command-line interface for real-time usage
28+
29+
---
30+
31+
## ⚙️ Usage
32+
33+
### 🔧 Requirements
34+
- Python 3.x installed
35+
36+
### 🏃 Run via Command Line
37+
38+
```bash
39+
python caesar_cipher_tool.py <mode> <shift> "<text>"
40+
````
41+
42+
* `<mode>`: `e` for encrypt, `d` for decrypt
43+
* `<shift>`: Number of positions to shift
44+
* `<text>`: The message to process (wrap in quotes)
45+
46+
---
47+
48+
## 🧪 Examples
49+
50+
### Encrypt:
51+
52+
```bash
53+
python caesar_cipher_tool.py e 4 "meet at library at 5pm"
54+
```
55+
56+
Output:
57+
58+
```
59+
Result: qiix ex plevvex ex 5ts
60+
```
61+
62+
### Decrypt:
63+
64+
```bash
65+
python caesar_cipher_tool.py d 4 "qiix ex plevvex ex 5ts"
66+
```
67+
68+
Output:
69+
70+
```
71+
Result: meet at library at 5pm
72+
```
73+
74+
---
75+
76+
## 💡 Real-world Scenario
77+
78+
You and a friend agree on a shift value (e.g., 4). You encrypt a secret note and send it. Your friend uses the same script and shift value to decrypt it.
79+
80+
---
81+
82+
## 🛠️ How It Works
83+
84+
The script:
85+
86+
1. Loops through each character in the message.
87+
2. Applies a shift based on encryption or decryption mode.
88+
3. Converts characters using ASCII math and wraps alphabetically using `% 26`.
89+
4. Non-alphabet characters are preserved.
90+
91+
```python
92+
chr((ord(char) - base + shift) % 26 + base)
93+
```
94+
95+
96+
* `ord(char)` – ASCII of char
97+
* `base``ord('a')` or `ord('A')`
98+
* `shift` – Provided shift value
99+
100+
---
101+
102+
## 🧑‍🎓 Author
103+
104+
Built by Aakash — focused on cybersecurity, scripting, and real-world learning through hands-on tools.
105+
106+
---
107+
108+
109+

Image Encryption/README.md

Whitespace-only changes.

Image Encryption/decy_pic.jpeg

28.9 KB
Loading

Image Encryption/ency_pic.jpeg

28.9 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
def xor_encrypt_decrypt(input_path, output_path, key):
2+
try:
3+
with open(input_path, 'rb') as f:
4+
data = bytearray(f.read()) # Read image as byte array
5+
6+
for i in range(len(data)):
7+
data[i] ^= key # XOR each byte with key
8+
9+
with open(output_path, 'wb') as f:
10+
f.write(data)
11+
12+
print(f"[+] Process completed. Output saved to: {output_path}")
13+
except FileNotFoundError:
14+
print("[-] File not found. Please check the path.")
15+
except Exception as e:
16+
print(f"[-] Error: {str(e)}")
17+
18+
# Example usage
19+
if __name__ == "__main__":
20+
print("Image Encryption/Decryption Tool")
21+
input_file = input("Enter image path: ")
22+
output_file = input("Enter output file path: ")
23+
key = int(input("Enter a secret key (0-255): "))
24+
25+
if 0 <= key <= 255:
26+
xor_encrypt_decrypt(input_file, output_file, key)
27+
else:
28+
print("[-] Key must be between 0 and 255.")

Image Encryption/oggy.jpeg

28.9 KB
Loading

Keylogger/README.md

Whitespace-only changes.

Keylogger/keylogger.py

Whitespace-only changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import re
2+
from colorama import Fore, Style, init
3+
4+
init(autoreset=True) # Automatically reset to default after each print
5+
6+
def check_password_strength(password):
7+
score = 0
8+
if len(password) >= 8:
9+
score += 1
10+
if re.search(r"[A-Z]", password):
11+
score += 1
12+
if re.search(r"[a-z]", password):
13+
score += 1
14+
if re.search(r"\d", password):
15+
score += 1
16+
if re.search(r"[!@#$%^&*(),.?\":{}|<>]", password):
17+
score += 1
18+
19+
if score <= 2:
20+
return "Weak", Fore.RED + "🔴 Weak"
21+
elif score == 3 or score == 4:
22+
return "Medium", Fore.YELLOW + "🟠 Medium"
23+
else:
24+
return "Strong", Fore.GREEN + "🟢 Strong"
25+
26+
def main():
27+
print(Fore.CYAN + "🔐 Password Strength Checker\n")
28+
pwd = input("Enter your password: ")
29+
level, colored_output = check_password_strength(pwd)
30+
print(f"\nPassword Strength: {colored_output}")
31+
32+
if __name__ == "__main__":
33+
main()

0 commit comments

Comments
 (0)