Skip to content

Conversation

@Shewale41
Copy link

Added One-Time Pad Cipher Implementation

This pull request adds an implementation of the One-Time Pad Cipher under the ciphers package.
The One-Time Pad Cipher is a symmetric encryption technique that XORs plaintext with a random key of equal length, providing perfect secrecy when the key is truly random and used only once.

Features:

  • Uses SecureRandom for key generation.
  • Provides methods for both encryption and decryption using XOR.
  • Includes JavaDoc with reference to the official algorithm documentation.

I have read CONTRIBUTING.md.
This pull request is all my own work — I have not plagiarized it.
All filenames are in PascalCase.
All functions and variable names follow Java naming conventions.
All new algorithms include a reference link in their comments.
All code is formatted with clang-format -i --style=file path/to/your/file.java.

File Added:
src/main/java/com/thealgorithms/ciphers/OneTimePadCipher.java


Fixes issue: #6941

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.19%. Comparing base (21eff8a) to head (1e78a3f).

Files with missing lines Patch % Lines
...va/com/thealgorithms/ciphers/OneTimePadCipher.java 0.00% 22 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6966      +/-   ##
============================================
- Coverage     78.26%   78.19%   -0.08%     
  Complexity     6573     6573              
============================================
  Files           743      744       +1     
  Lines         21895    21917      +22     
  Branches       4288     4290       +2     
============================================
  Hits          17137    17137              
- Misses         4074     4096      +22     
  Partials        684      684              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants