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
/goPublic

crypto/cipher: add one-time pad encrypt and decrypt#76836

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
vivaidris wants to merge1 commit intogolang:master
base:master
Choose a base branch
Loading
fromvivaidris:dev.ciphercrypto.go.1.25.5

Conversation

@vivaidris
Copy link

Adds a One-Time Pad (OTP) implementation to crypto/cipher.

OTP is a type of encryption that is provably secure
information-theoretically when used correctly. It
requires a key that is the same length as the message
and used only once.

This package provides the following:

  • OTPEncrypt and OTPDecrypt functions for encryption
    and decryption of byte slices.
  • KeyGen function for generating cryptographically
    secure random keys of the appropriate length.
  • A simple unit test (otp_test.go) that verifies
    encryption and decryption works correctly.

Note: OTP is not intended to be used in real-life practice
as it has highly limited capabilities and can only be used once
for the safest encryption, making it highly inefficient.

@google-cla
Copy link

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View thisfailed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@vivaidris

[8]ページ先頭

©2009-2025 Movatter.jp