-
Notifications
You must be signed in to change notification settings - Fork 20.9k
Open
Labels
Description
What would you like to Propose?
Title: Add One-Time Pad Cipher Implementation
🧠 Overview
The One-Time Pad (OTP) is an unbreakable cipher (if key truly random and used once). Implementing it helps demonstrate the concept of perfect secrecy in cryptography.
📂 Implementation Details
- Folder:
src/main/java/com/thealgorithms/ciphers/ - Filename:
OneTimePadCipher.java - Approach:
- Generate a random key same length as plaintext.
- XOR plaintext with key for encryption.
- Apply XOR again for decryption.
✅ Expected Deliverables
- Complete encrypt/decrypt implementation.
- Example with random key generation.
- Tests for multiple plaintext lengths.
- Comments explaining cryptographic limitations (key reuse).
🧑💻 Additional Notes
A simple yet powerful algorithm showing fundamentals of symmetric encryption and XOR logic.
Issue details
🧠 Overview
The One-Time Pad (OTP) is an unbreakable cipher (if key truly random and used once). Implementing it helps demonstrate the concept of perfect secrecy in cryptography.
Additional Information
No response
Reactions are currently unavailable