Hacktoberfest-2k18 icon indicating copy to clipboard operation
Hacktoberfest-2k18 copied to clipboard

Implement One Time Pad

Open aditigupta17 opened this issue 6 years ago • 5 comments

Description

The one-time pad (OTP) is an encryption technique that cannot be cracked, but requires the use of a one-time pre-shared key the same size as, or longer than, the message being sent. In this technique, a plaintext is paired with a random secret key (also referred to as a one-time pad). Then, each bit or character of the plaintext is encrypted by combining it with the corresponding bit or character from the pad using modular addition.

Input:

  • A String of lower case letters, called Plain Text.
  • Another String of lower case letters, called OTP.

You are expected to write a program that receives a Plain Text (string) and OTP (string) and returns the encrypted ciphertext.

Example: Plain Text: quizzingisfun OTP: tequilamockingbird Cipher Text: jyythtnswupca

Details

Technical Specifications:

  • Type of issue: No more than one implementation will be accepted for each language. Once the implementation for a language has been taken up (i.e if it is checked in the 'Issue Progress' section), you must choose from the remaining.
  • Time Limit: Issues will be given on a first-come, first-serve basis. Once you take this issue up, you must complete it within 2 days, failing which the issue will be allocated to the next person who requested for this issue.
  • Additional instructions: While making the Pull Request, attach screenshots of 5 sample inputs and their corresponding output.

Issue requirements / progress

  • [x] C
  • [ ] C++
  • [x] Python
  • [ ] Java

Resources

https://en.wikibooks.org/wiki/Cryptography/One_time_pads

Directory Structure

For this issue, use the following directory of the Hacktoberfest-2k18 repository: /systems/cryptography/one-time-pad/<language_name> (where language_name is one of the languages mentioned above.)

Note

Please claim the issue first by commenting here before starting to work on it.

aditigupta17 avatar Oct 16 '18 05:10 aditigupta17

Im willing to contribute on this issue. (Lang: Python)

yogeshjoshi avatar Oct 16 '18 06:10 yogeshjoshi

@yogeshjoshi Go ahead.

aditigupta17 avatar Oct 16 '18 09:10 aditigupta17

Can I claim C?

andymac-2 avatar Oct 16 '18 12:10 andymac-2

@andymac-2 Sure. Go ahead.

aditigupta17 avatar Oct 16 '18 17:10 aditigupta17

I want to solve this for lang: Java

KshitijMhatre avatar Oct 19 '18 19:10 KshitijMhatre