Java icon indicating copy to clipboard operation
Java copied to clipboard

Add One-Time Pad Cipher implementation

Open Nihhaar0002 opened this issue 3 months ago • 1 comments

This PR adds an implementation of the One-Time Pad (OTP) cipher using XOR.

  • Generates a random key using SecureRandom.
  • Encrypts and decrypts using XOR.
  • Validates matching key and message length.
  • Includes JUnit tests for multiple cases.
  • Adds comments explaining cryptographic limitations.

All tests passed successfully.

Nihhaar0002 avatar Nov 25 '25 06:11 Nihhaar0002

Codecov Report

:x: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 78.52%. Comparing base (1c6026e) to head (29eae56).

Files with missing lines Patch % Lines
...va/com/thealgorithms/ciphers/OneTimePadCipher.java 86.66% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7113      +/-   ##
============================================
+ Coverage     78.50%   78.52%   +0.01%     
- Complexity     6752     6758       +6     
============================================
  Files           759      760       +1     
  Lines         22402    22417      +15     
  Branches       4400     4402       +2     
============================================
+ Hits          17587    17602      +15     
  Misses         4109     4109              
  Partials        706      706              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov-commenter avatar Nov 25 '25 06:11 codecov-commenter

This pull request has been automatically closed because its workflows or checks failed and it has been inactive for more than 14 days. Please fix the workflows and reopen if you'd like to continue. Merging from main/master alone does not count as activity.

github-actions[bot] avatar Dec 10 '25 03:12 github-actions[bot]