Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[FEATURE REQUEST] One-Time Pad Cipher #6941

Copy link
Copy link
@Shewale41

Description

@Shewale41
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.