Latest Crypto related questions

Score: 0
Witness Recovery in SPDZ Offline Phase
ru flag

I am currently reading SPDZ: https://eprint.iacr.org/2011/535.pdf. The MPC protocol uses an encryption scheme $\operatorname{Enc}_{\operatorname{pk}}(x,r)$ based on Brakerski, V. Vaikuntanathan (Gentry) (e.g. https://link.springer.com/chapter/10.1007/978-3-642-22792-9_29) in the offline phase. Here $\operatorname{pk}$ is the public key, $x$ the message, $r$ the randomness used in the encryption. I ...

Score: 1
Sam Jaques avatar
Reducing a lattice basis with too many basis vectors
us flag

Suppose I have a basis $B$ of an $n$-dimensional lattice $L\subseteq\mathbb{Z}^n$ and $B$ has $n$ vectors. Now I take another $v\in \mathbb{Z}^n\setminus L$ and I define a new lattice $L'=L+\mathbb{Z}v$. The set of vectors $B':=B\cup\{v\}$ generates $L'$, but since $L'$ is $n$-dimensional, it's rank is at most $n$, so $B'$ is too big. So there must be some other basis that generates $L'$. How do we  ...

Score: 0
fadedbee avatar
AES256-GCM Is it safe to both add the IV to the AAD and use it in the encryption?
br flag

I'm looking at a protocol which adds the IV (used for the encryption) into the AAD.

If the IV (which is part of the message) was incorrect, decryption would fail anyway.

Why is it useful to add the IV to AES256-GCM's AAD?

Is it actively harmful?

Score: 1
How does this code calculating AES S-Box work?
us flag

How does this code calculating the AES S-Box work? I don't understand the overall calculation procedure. Code is attached below:

function generate(irreducible_poly){
    try{
        p = parseInt(eval(irreducible_poly.replace(/x/g, '10')), 2);
    } catch(err){
        console.log('Irreducible Polynomial invalid');
        return;
    }

    let t = new Uint32Array(256);
    for (let i = 0, x = 1; ...
Score: 2
phantomcraft avatar
Does keeping IV secret increase security of CTR mode?
pf flag

Let's suppose I encrypt something with CTR mode and keep the key and IV secret.

Does keeping the IV secret together with the key increase strength of encryption?

Score: 0
Foobar avatar
Why are there different versions of the Pohlig-Hellman attack?
fr flag

I think I have an understanding of the Pohlig-Hellman attack on elliptic curves. From page 31 of Pairings for Beginners:

  • Find the group order $\#E(\mathbb{F}_q)$, call it $n$, and factor it. Example: $966 = 2 \cdot 3 \cdot 7 \cdot 23$
  • For each prime factor $p_i$, above: multiply the generator $P$ and target point (not sure what the term is), $Q$, by $n/p_i$ (the cofactor)
    • This particular exampl ...
Score: 0
Breaking RSA with knowledge of the secret key $(n, d)$
jp flag

I am following the discussion in Koblitz in the second paragraph in the RSA section (page 94 on my edition).The goal is to show that knowledge of an integer $d$ such that $$m^{ed}\equiv m \mod n$$ for all $m$ with $(m,n)=1$ breaks RSA.The problem is that I'm no mathematician and I need some help to untangle myself at various points.

He first states that this is equivalent to $k=ed-1$ being a mult ...

Score: 0
Billy avatar
What curves can be used with what algorithms?
in flag

I've been trying to improve my understanding of elliptic-curve cryptography; I'm currently trying to understand the extent to which curves are interchangeable.

Examples of curves: P-256, Curve25519
Examples of algorithms: ECDH, ECDSA, EdDSA

Of the curves I listed, I've read that both are used with ECDH, but I've only read of P-256 being used with ECDSA and Curve25519 being used with EdDSA. Why can both c ...

Score: 1
Proving to a 3rd party an email received in [email protected] was truly sent from [email protected]
th flag

Example:

  1. I send an email from [email protected] to [email protected]
  2. Using only the email I received in [email protected], I'd like to prove to a 3rd party that I also own [email protected]

Edit: assume I don't own neither domain1 nor domain2, just have email addresses in both (gmail and hotmail, for example)

Are there established ways to achieve this?

Score: 9
kelalaka avatar
Who is the inventor of the OFB block cipher mode of operation?
in flag

Handbook of Applied Cryptography gives two resources for the OFB mode

  1. 1980 FIPS 81. This doesn't give any references, unlike NIST.
  2. 1983 ANSI X3.106, unfortunately pay-walled.

Who is the inventor of the OFB mode of operation?

Score: 0
Sohail avatar
Why is this code working
de flag

I was doing some introductory challenges at CryptoHack and one of the challenges, more precisely it was Favourite Byte, XOR with a single byte.

I did my solution with XORing given string and single key iterated over 256 integers till I find something that looks like "flag".

Then I looked for submitted solutions and one of the solutions was:

input_str = bytes.fromhex('73626960647f6b206821204f21254f7d69 ...
Score: 1
Trimming uniformly random input for elliptic curve private keys
ru flag

Imagine there is 256-bit uniform input from CSPRNG. Suppose there is a curve like secp256r1 whose curve order is slightly less than 256 bits.

We cannot just mod(input, curve_order) because it will introduce modulo bias. What if we trim 256 bits to 255 bits which is less than curve order? Then all values within 255 bits will have an equal chance of appearance.

ed25519 seems to do exactly that, with their ...

Score: 1
Ruthie avatar
Is it possible to decrypt my message if encrypt it twice using different keys each time?
ke flag

Suppose I want to encrypt $mssg$ using One-Time-Pad, and I want the $mssg$ to be encrypted twice.

Once with $k_1$ and second with $k_2$

Is it still possible to detect my $mssg$?

lets say:

  • $c_1 = mssg \oplus k_1$
  • $c_2 = mssg \oplus k_2$

$c_1 \oplus c_2 = k_1 \oplus k_2$

Score: 1
zkSNARKS: If we are already using Homomorphic Encryption/Hiding, why is the shift by $\delta$ required for Zero Knowledge?
et flag

I am reading this explanation of zkSnark written by Maksym Petkus - http://www.petkus.info/papers/WhyAndHowZkSnarkWorks.pdf

From Section 3.5

Because verifier can extract knowledge about the unknown polynomial $p(x)$ only from the data sent by the prover, let us consider those provided values (the proof): $g^p$, $g^{p'}$, $g^h$. They participate in the following checks:

$g^p = (g^{h})^{t(s)}$ (poly ...

Score: 3
John Pham avatar
Elliptic Curve how to calculate y value
vn flag

I have been reading the book Mastering Bitcoin written by Andreas. It was the process of compressing public keys that hurt my mind. Specifically, a public key after being generated from a private key fundamentally comprises the resulting coordination of x and y.

The book said that since y value can be gained from x via the function: $$y^2\bmod p=(x^3 + 7)\bmod p$$We can reduce the size by just storin ...

The Stunning Power of Questions

Much of an executive’s workday is spent asking others for information—requesting status updates from a team leader, for example, or questioning a counterpart in a tense negotiation. Yet unlike professionals such as litigators, journalists, and doctors, who are taught how to ask questions as an essential part of their training, few executives think of questioning as a skill that can be honed—or consider how their own answers to questions could make conversations more productive.

That’s a missed opportunity. Questioning is a uniquely powerful tool for unlocking value in organizations: It spurs learning and the exchange of ideas, it fuels innovation and performance improvement, it builds rapport and trust among team members. And it can mitigate business risk by uncovering unforeseen pitfalls and hazards.

For some people, questioning comes easily. Their natural inquisitiveness, emotional intelligence, and ability to read people put the ideal question on the tip of their tongue. But most of us don’t ask enough questions, nor do we pose our inquiries in an optimal way.

The good news is that by asking questions, we naturally improve our emotional intelligence, which in turn makes us better questioners—a virtuous cycle. In this article, we draw on insights from behavioral science research to explore how the way we frame questions and choose to answer our counterparts can influence the outcome of conversations. We offer guidance for choosing the best type, tone, sequence, and framing of questions and for deciding what and how much information to share to reap the most benefit from our interactions, not just for ourselves but for our organizations.