Questions tagged [cryptography]

Questions on the mathematics behind cryptography, cryptanalysis, encryption and decryption, and the making and breaking of codes and ciphers.

Please only post questions about the mathematics of cryptography here.

  • Coding and implementation specific questions should go to Stackoverflow with encryption or cryptography tags.
  • You may also consider asking at Cryptography Stack Exchange which is for asking questions about the mathematics and properties of cryptographic systems, their analysis ("cryptanalysis") and subsidiary topics that generally make up cryptology.
1915 questions
1
vote
2 answers

Analyzing and decoding ciphertext

I have a worksheet which contains a dozen ciphertexts where the goal is to decrypt the encrypted English sentence(s). No information is given about what the text contains or what cipher methods are used. I've reach the last question but am stuck on…
tina nyaa
  • 451
1
vote
0 answers

Single-Digit Errors

I've been assigned the following homework problem: Given an eight digit number $a_1a_2...a_8$ and a check digit $a_9$, $7a_1+3a_2+9a_3+7a_4+3a_5+9a_6+7a_7+3a_8+9a_9 \equiv 0 \mod{10}$ This method detects all errors where only one digit is changed.…
1
vote
1 answer

how to find co-prime numbers

Suppose $p$ and $q$ are two prime numbers. How can one quickly calculate how many numbers $x$ there are such that $\gcd(x, (q-1)\cdot(p-1)) = 1$, without using brute force?
Rn2dy
  • 231
1
vote
0 answers

Using knapsack problem for digital signatures

Is it possible to use the knapsack problem for digital signatures? What I am imagining is something like the Merkle–Hellman knapsack cryptosystem, but used for digital signing, rather than encryption. It seems that the knapsack problem is well…
Void Star
  • 2,555
1
vote
2 answers

How to make RSA function injective

I'm trying to make the RSA function $ F(c) = m^e \mod n $ injective (ie, always generates a unique value for $ c $ / don't repeat values in set $ C $). Through some research, I've found this is possible through a specific value of $ e $, but I can't…
1
vote
1 answer

RSA modulus and order of multiplicative elements

Given an $n=pq$ where $p$ and $q$ are odd, distinct primes. Let $\alpha \in \mathbb Z_n^*$ and $\text{ord}_n(\alpha)$ be the order of $\alpha$ in $\mathbb Z_n^*$. The text claims that: $\text{ord}_n(\alpha) =…
1
vote
2 answers

How to decrypt the message?

I have difficulties with decrypting a message and i would be very glad if someone could help me to solve the following problem: Given is $n=10010$ and an encryption map $e:\mathbb{Z}_{2}^{5}\rightarrow \mathbb{Z}_{n}$, where $(m_{1},m_{2}, m_{3},…
Lullaby
  • 2,361
1
vote
1 answer

2nd Order Homomorphic Encryption?

For a while the concept of Homomorphic encryption has existed which is the concept of encrypting data and still being able to manipulate it as if it was unencrypted. Would it be theoretically possible to create a scheme such that not only the data…
1
vote
1 answer

Min and max value of index of coincidence

I am pretty new to cryptography and trying to understand some mathematical aspects. Studying different types of cipher, I came across the definition of index of coincidence which is as follows: Index of coincidence for a ciphertext of length $n$,…
xterg
  • 11
  • 3
1
vote
0 answers

NTRU cryptosystem lattice reduction attack

I need help understand the attack on NTRU cryptosystem https://en.wikipedia.org/wiki/NTRUEncrypt For example: Given Alice’s public key: q = 131 and h = 100. Suppose that Bob sends the encrypted message e =78. I do the attacker find his message m…
Mzq
  • 252
1
vote
1 answer

How to find unknown (pseudo-random) number in crypto algorithm equation, similar to RSA

I am trying to solve a past CTF (Capture the Flag) event crypto question. The algorithm is similar to RSA: it generates a public and private key, then encrypts the flag with the public key. It looks similar to RSA, except the encryption is done with…
1
vote
1 answer

ElGamal same private and random key attack

I'm having difficulty understanding this. Consider two messages are encrypted using the same cyclic group order $q$, generator $g$, private key $x$, and random parameter $y$. The attacker knows a plaintext $m_1$ and its corresponding ciphertext…
1
vote
0 answers

Show that a shift cypher is perfectly secure..

Using the formula $$ P(X =x|Y =y) = \frac{ P(X =x)∗\sum{_{x\in D_k(y)}}{P(K =k)} }{\sum{_{k|y \in C(k)}}P(K =k)∗P(X =D_k(y)). } $$ to show is that if all 26 keys $z$ are equally probable, the shift cipher is perfectly secure - for one-letter plain…
jelu1999
  • 21
  • 3
1
vote
1 answer

Why can this cryptosystem be easily broken?

I am having trouble understanding the concept of public-key cryptography and why some cryptosystems can be easily broken when used in a certain way. Here is an example. Suppose we have a communication network where every user $U$ has an enciphering…
kubo
  • 1,918
1
vote
0 answers

Discrete Logarithm Problem in $\mathbb{F}_{p}$ and using Elliptic curves

I want to learn about the hardness of the DLP in $\mathbb{F}_{p}$ and using Elliptic curves, and the best attacks against each. I want to be able to compare the hardness of the problem in the two setups. \ Can someone suggest me some useful links,…
Shiva
  • 561