Latest Crypto related questions

Score: 1
PyhonLovers avatar
'str' object has no attribute 'decode' when decrypt aes
st flag

so i have function to decrypt aes ctr. but when i tried to decrypt, the result i got from plaintext is type bytes. i want to get the result of plaintext using decode, because when i encrypt it, i was encode it first.

here's my encrypt func:

def encrypt(key, pt):
    plaintext = read_file(pt)
    if isinstance(plaintext, str):
        pt= plaintext.encode("utf-8")
        print(pt)
        print(type(p ...
Score: 3
Dniel BV avatar
Will XORing two bad hashes lead to a collision resistant hash?
st flag

I'm reading the fourth edition of "Cryptography: Theory and Practice" by D.R. Stinson and M.B. Paterson. In the book, they have mentioned the concept of "collision-resistant hash" and I've stumbled upon the following question from another source:

Is there a collision resistant hash function $h(x)=h_1(x)\oplus h_2(x)$ so that $h_1$ and $h_2$ are not collision resistant?

It seems interesting to thin ...

Score: 0
tiredpotato avatar
MD5 , inputs larger than 512 bits
vi flag

So I get how it works for inputs shorter than $512$, but as for larger inputs "In the case where the remaining input data is exactly $448$ bits long, an entire extra block would need to be added for the padding." what do they mean by the 'remaining' input data is exactly $448$ bits long? if input was like, lets say $500$ bits, $1024-64=960$, $960 - 500= 460$, so $500 + 1 + 459$ zero's, followed by the ...

Score: 1
jackson deng avatar
Why the output of G-lattice sampling is spherical in the paper GM18?
it flag

In the paper GM18, they say that the sampling algorithm, SampleG, is shown in Figure 2. It takes as input a modulus $q$, an integer variance $s$, a coset $u$ of $\Lambda^{\perp}(g^T )$, and outputs a sample statistically close to $D_{\Lambda^{\perp}_u(g^T),s}$. SampleG relies on subroutines Perturb and SampleD where Perturb($\sigma$) returns a perturbation, $p$, statistically close to $D_{L(\Sigma_2),\s ...

Score: 2
Joseph avatar
Understanding AES-GCM IV (Nonce), Tag/MAC, Message & Transmission
uz flag

I am working on a project that uses PAKE (SRP) for authentication. When we send the M1 to the server we are encrypting the payload using AES-GCM. I mention SRP only to set the context:

  1. A message is being sent to the server with content we want to protect
  2. The client and server have a unique (one-time) symmetric key shared between them (thanks to SRP)

Before I encrypt the payload I generate a unique ...

Score: 0
George Cherian avatar
Finding out the hashing algorithm and salt if you know the password and the resultant hash
pk flag

If I have the password and hash will I be able to find out the Hashing algorithm and salt used. What tools can I can use? Will hashcat work?

Score: 2
nickponline avatar
Does Pohlig-Hellman algorithm work for non-prime powers?
gw flag

I implemented the Pohlig-Hellman algorithm for the general case following Wikipedia but it only seem to work for prime powers (which is what the limited case is meant to solve).

My implementation follows wikipedia exactly: https://gist.github.com/nickponline/2ef6f3456ed6c423239a334c98728324

Some examples where it fails to find a solution are:

39^x = 49 (mod 74) x = 28
19^x = 423 (mod 478) x = 275
71^x ...
Score: 2
Karthik B K avatar
multiplicative inverse computations on binary galois fields yield partial result when sampled
us flag

I want to compute the multiplicative inverse of 0x2 over $GF(2^{233})$ in hardware.

To do so, I compute $a^{-1} = (a^{2^{m-1}-1})^{2}$. Here's the result of that computation: 0x10000000000000000000000000000000000000002000000000000000000 (where the left-most 1 is bit index 233, not 232).

I verify that I get 1 by multiplying it with the initial number using a binary Karatsuba multiplier.

I'm also able t ...

Score: 2
luishernandex avatar
Construct PRG from PRF with polynomial expansion factor
cu flag

I want to prove that for every pseudorandom function $F: \{0, 1\}^n \times \{0, 1\}^n \rightarrow \{0, 1\}^n$ and for every polynomial $p$ such that $p(n) > 1$ for every $n$ it is possible to construct, starting from $F$, a pseudorandom generator $G$ having expansion factor equal to $l(n) = p(n) \cdot n$.

I fixed a PRF $F$ and came up with two constructions for $G$ (where || denotes the concatenatio ...

Score: 4
Hormoz avatar
How secure is SHA-1 against preimage attacks currently?
us flag

We know that SHA-1 is susceptible to collision attacks, but what about pre-image attacks such as poisoning torrents?

Score: 2
Vlad avatar
Can export of wrapped secret key to insecure storage be cryptographically secure?
in flag
  1. I ask because some vendors of HSM try to avoid the export of wrapped secret key from HSM to insecure storage – storage that does not belong to these vendor’s HSM infrastructure.

    For example, Thales prefer to backup keys to another Thales HSM – most of their documentation is about cloning between their devices. But Thales has an option when they send traffic via public networks: Backup HSM Insta ...

Score: 0
fgrieu avatar
Definition of "zero-knowledge encryption"
ng flag

I'm reading headlines on the tune of "…bring zero-knowledge encryption to file storage". Googling "zero-knowledge encryption" returns statements like "cloud storage or backup providers know nothing (i.e. have “zero-knowledge”) about the data you store on their servers".

Is there some academic definition of "zero-knowledge encryption" and how is it different from just encryption?

Score: 1
Mark Thomas avatar
How do AES Substitution box's offer any additional security since it's 1 to 1?
ga flag

If the Substitution box is 1 to 1 (a specific value can only ever be a specific box value), and the contents of Rijndael S-box is public, how does this offer any additional security?

With AES the frequency of a letter isn't a concern so what other reason is there for this substitution? An explanation fitting for a novice would be very much appreciated!

Additionally, why is Rijndael S-box a multiplic ...

Score: 2
youngeAn avatar
Proof of Pohlig-Hellman Algorithm on Elliptic Curve
ai flag

I've been reading for Pohlig-Hellman Algorithm on Elliptic Curve.

My question is, why the simultaneous congruence gives the answer we want, could somebody please provide a proof of it?

i.e., why

\begin{align*} x \equiv x_i \mod p_i^{e_i}, \forall i\in \{1,2,...,n\} \end{align*}

Reference: https://risencrypto.github.io/PohligHellman/

Score: 0
user206904 avatar
in signed group key exchange, why do we need to sign a session id?
co flag

I have seen a few papers on (contributive) group key exchange where users create Keys and broadcast them so they can all contribute to the secret key. In order to protect against active attackers, several schemes use signature primitives.

They generate some sort of hashed session id, sign it with the message (via some method that I did not fully understand) and broadcast the outcome...

What I fail t ...

Score: 1
Carl_Dude avatar
Is considered safe saving encrypting files using asymmetric encryption algorithm inside public environments?
sh flag

I know restricting access of a file, is a important measure of security.

If we read the Payment Card Industry's Data Security Standard (aka PCI-DSS), we can see a requirement where control access must be applied to mitigate any risk of a sensitive encrypted data be leaked from the system.

Other important requirement define minimum data to be kept encrypted, again mitigating possible leak.

I would l ...

Score: 2
SarkoxedaF avatar
1st round attack on rc4
bj flag

I'm trying to implement the 1st round attack on RC4 stream cipher according to Attacks on the RC4 stream cipher. For now I am interested in section 4.2 Attack on other key bytes. It works really fine for all the bytes of the random key of length 8, except the 2nd byte. The needed value t is always the second frequent one, whereas the most frequent is 2, which corresponds to the second byte of stream  ...

Score: 0
Per avatar
CPU cost of signing vs. encrypting
vu flag
Per

I'm protecting communication between some microservices using public/private key encryption, where the sending container has a public key and the receiving container has a private key. This both verifies the sender (only sender has the public key via a credential manager), and protects the data in case it may be buffered, e.g. in a Redis.

But for transient communication, I'm wondering if signing  ...

Score: 3
Ricardo Martínez avatar
Why is ZKP authentication not used in practice?
vn flag

I have been reading about Zero Knowledge Proof (ZKP) protocols for a while now. Among the applications I have seen the most is authentication (https://ethereum.org/en/zero-knowledge-proofs/#authentication). But in practice it is not used; why?

I have also been looking for why these protocols are not used in authentication systems or why they are not used by identity providers (such as Google accoun ...

Score: 1
IND-CPA secure PKE from search problem
US flag

Is there any PKE scheme that is IND-CPA secure (in a standard model, not RO) under a search problem?

Score: 3
CryptoGuru avatar
Password Hashing based on Common Passwords
bm flag

If an attacker has a database of 1,000 users' hashed passwords which are hashed with SHA-256 with a 128-bit salt and all of these users used 10,000 common passwords. How many hashes will the hacker need to do to recover all passwords?

I was thinking it would just be 1,000*10,000 = 10,000,000 hashes but I am not sure how the salt affects the computation in recovering hashes.

Score: 2
LianoQ avatar
Info AES cryptanalysis
bi flag

I have some doubts regarding AES weakness and AES cryptanalysis. While it is relatively simple to find Cryptanalysis info on previous ciphers, I get confused about understanding various types of Cryptanalysis attacks on AES.

So far, for example, I've found that AES's weakness could be in its algebraic structure. Anyone knows good references where I can find more precise info on AES cryptanalysis ...

Score: 2
Ilya Nevolin avatar
Which service provider can create (claimable) accounts for managing Ed25519 keypairs (zero-knowledge fashion) by email
dz flag

The title is a mouthful, allow me to explain my situation.

  • I have a SaaS with many users.
  • When new users join the platform, I want to create a cryptographic keypair for them (Ed25519).
  • But I don't want to have any knowledge about their private key.
  • This means the keypair must be generated and stored by a third-party service.

So I'm looking for a service, which has an API endpoint that works as such: ...

Score: 0
Libertarian Feudalist Bot avatar
File Size Shrinks After Encryption
us flag

I am a Bitcoin enthusiast, but I have never been formally trained in the study of computer science and cryptography.

Recently, I tried a new way to encrypt my private key: I wrote it down on a paper, and used my camera to take a photo of that paper sheet. Then, I encrypted the photo from pgp4win.

Then I noticed that the size of the photo is significantly smaller after encryption.

Can any expert in cryp ...

Score: 1
phantomcraft avatar
Is BLAKE2X suitable for generating keys with any security in bits event if BLAKE2 having only 256/512-bits?
pf flag

I can generate a key of any security in bits with any hash function from random source with enough entropy by using the following scheme:

$$H(00||S) || H(01||S) || H(02||S) || H(03||S) || \cdots$$

/\ H is the hash, S the seed and 00, 01, 02 the counters.

BLAKE2X hashes are computed as follows:

$$\operatorname{B2}(0,64,H_0)\mathbin\|\operatorname{B2}(1,64,H_0)\mathbin\|\ldots\mathbin\|\operatorname{B2 ...

Score: 1
akib g avatar
Design ZKP to satisfy x1*x2(mod n)=x3 from(Pallier encryptions)
fm flag

I have 3 Pailler encryption p1=E(x1;r1),p2=E(x2;r2);p3=E(x3;r3) such that x1*x2(mod n)=x3. P(Prover) knows (x1,r1);(x2,r2);(x3,r3).

Can I design a ZKP(interactive & non-interactive) for P to convince V(verifier) that values hidden by p1,p2,p3 satisfy x1*x2(mod n)=x3.

Score: 3
user3325588 avatar
Are there any projects leveraging a combination of (1) Noise and (2) Signal / Double Ratchet to augment the former with per-message forward secrecy?
br flag

Are there examples (in code, or a blog post / writeup) of using Noise and Signal together?

Here is a link to Noise.

For example, using the Double Ratchet per each message to achieve forward secrecy, but leveraging Noise as a foundation for its patterns of initial key exchange. Both Noise and Signal are well-studied and well-known, and so building upon these might be preferred over attempting to c ...

Score: 3
Ra2orLeaf avatar
What is a block transposition cipher?
sa flag

I was looking at the archives for the British national cipher challenge, and a modified version of an ADFGVX cipher came up twice (2003 2011), with block transposition instead of columnar transposition. The question I has is what is this referring to? I tried finding information about block transposition, but there appears to be many different versions of it as per wikipedia. The cipher challenge is ...

Score: 0
testCrypto avatar
Computing the eth root in Z(N)* i.e set of all elements coprime to N
tt flag

I understand that it is easy to compute eth root in Z(P)* but what about with Z(N)? I know that it requires the factorization of N but what does that actually mean? What is an example of calculating the eth root in the set Z(N) (the set of all elements coprime to N)

Score: 2
8cold8hot avatar
Safe p-value for NIST randomness test with small sample size
cn flag

In this journal paper related to physically unclonable function (PUF) [1], the authors used NIST 800-22 test to check if the bitstreams generated by their PUFs are random, which is described as follows:

NIST tests are performed using 60 sequences of 128 bits each such that 7680 bits (i.e., digitized keys) collected from 30 different PUFs are tested. The chi-squared (χ2) distribution is used to com ...

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.