Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Add One-Time Pad Cipher implementation#7113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Nihhaar0002 wants to merge2 commits intoTheAlgorithms:master
base:master
Choose a base branch
Loading
fromNihhaar0002:otp-cipher

Conversation

@Nihhaar0002
Copy link

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.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is86.66667% with2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.52%. Comparing base (1c6026e) to head (29eae56).

Files with missing linesPatch %Lines
...va/com/thealgorithms/ciphers/OneTimePadCipher.java86.66%1 Missing and 1 partial⚠️
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

☔ 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 freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@DenizAltunkapanDenizAltunkapanAwaiting requested review from DenizAltunkapanDenizAltunkapan is a code owner

@yanglbmeyanglbmeAwaiting requested review from yanglbmeyanglbme is a code owner

@alxkmalxkmAwaiting requested review from alxkmalxkm is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Nihhaar0002@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp