Questions tagged [one-time-pad]

13 questions
8
votes
6 answers

One time pad, encryption and decryption

I am trying to pick up cryptography and had been trying this exercise Write a program (preferably Java) to generate a one-time pad, which is a relatively large file of all random data (say 1 MB). The program should also be able to encrypt/decrypt…
user1792962
  • 81
  • 1
  • 1
  • 3
1
vote
1 answer

How can OTP (one time password) be protected against brute force attacks?

We have a feature in our application that ask for a six digit OTP before doing certain functions. It is sent via SMS and expiration is 5 mins. There has been an internal penetration test that exposed that this is vulnerable to brute-force attacks.…
1
vote
0 answers

Self-Generating Key Program

BACKGROUND OF CODE: Below is a code that I'm working on. The purpose of this code is to use a seed to generate a long pseudo-random key. Work on using that key for encryption comes later. As of current, if a single character is used, it will spit…
0
votes
0 answers

Breaking Flawed One Time Pad

I have a cyphered OTP message and the sender made a mistake and used a key that was shorter than a message. The plaintext was not padded before encryption so length of c equals length of m. How could I calculate the length of the OTP key (k) used…
0
votes
1 answer

How to write One-Time Pad cipher in Python

Based on Wikipedia, One-Time Pad is an encryption technique that cannot be cracked. How to implement One-Time Pad encryption in Python?
Farshid Ashouri
  • 16,143
  • 7
  • 52
  • 66
0
votes
0 answers

Unknown One-time pad key

I'm taking this new cryprography class and i'm kinda stuck. here is the problem: "You know that the word “good” (let’s say message m), consisting of 4 characters, has been encrypted, through the OTP, into a known ciphertext c1. You don’t know…
0
votes
2 answers

Decrypting an image

I need to decrypt a png file. I can't open/view the image because it is encrypted. When I run the file command on the image in the command line, it says that it's a 'data' type. I know the image is encrypted using XOR (as in the case of one-time…
SugarDrink
  • 21
  • 3
0
votes
1 answer

One time pad cipher for numbers

Can one time pad cipher implemented for numbers? if yes, can you tell me the algorithm or the working code (preferably java) for the same? Also, what is the difference between one time pad and xor cipher.
Debopam
  • 3,198
  • 6
  • 41
  • 72
0
votes
1 answer

Equivalent strings don't give equivalent bitstrings in Python

I'm currently making an encryption program for an assignment however I cannot decrypt. The cause of this is that the key is a string made from a randomly generated bitstring however when turning the key back into a bitstring I get a different…
0
votes
0 answers

How to remove letter in space for One Time Pad cipher?

I have found this code somewhere on the web for reference yet this bothers me. The result is correct but somehow there is something wrong with the process. import java.io.*; import java.util.*; import java.util.Scanner; public class onetime{ …
Snow
  • 101
  • 3
  • 16
0
votes
0 answers

One-Time Pad user input text using a generated random bit

I have tried implementing a very simple OTP in python but for some reasons that I don't understand I am getting an error which says: "ValueError: Incorrect AES key length (4 bytes)". I am a newbie to python and OTP as well! Here is the code: from…
user9580162
0
votes
0 answers

Xor comparison in one-time pad cipher

I am using one-time pad cipher. When we use same key on two texts (m1, m2) then c1⊕c2 = m1⊕m2. Why isn't it the same? What am I missing? Here is example: m1: dog - 011001000110111101100111 m2: cat - 011000110110000101110100 key: pas -…
Tomas Kanok
  • 105
  • 10
-2
votes
1 answer

python loop result of sum within a range of 0 to 10 so that 2-4=9

So I am working on a script for numerical one time pads but the issue is that I would like the result of the sums to stay within a specific range of 0 to 10 so that 2-4=9 [9, 10, 0, 1, 2] 4-9=6 [6, 7, 8, 9, 10, 0, 1, 2, 3, 4] 7+8=4 [7, 8, 9, 10,…
jennyflysky
  • 43
  • 1
  • 7