instruction
stringlengths
32
27.2k
In NIST-SP-800-90Ar1, the Hash-DRBG is instantiated with hash functions using strange values for seed length (seedlen) such as 440, 888. How are these values derived? How to derive values for other hash functions?
I am given a key exchange protocol between a component $C$ and a key master $K$. During the overall execution 4 messages are transferred between $C$ and $K$. DH keypairs are always chosen randomly for each execution. Message (1) just contains the ID of the component. Message (2) contains the public-key of $K$ and a sig...
I'm studying Authenticated encryption with Associated Data (AEAD). My questions are About AE - I heard that when it comes to Encrypt-then-MAC, if an attacker forges the ciphertext then he gets the wrong MAC value and can't decrypt the ciphertext to plaintext. Is this correct? If so, what is happening Encrypt-and-MAC ...
I'd like to design a system where the following situation happens: I (person 1) have some secret key I hand out another secret key to a developer (person 2) Person 2 signs several files with his secret key Person 2 can now distribute his software among with mine to the users. In my software I'd like to be able to chec...
A correct proof (a proof which is indistinguishable from previously sent proof) can be tagged as wrong by the ideal functionality here if the adversary sends no witness. And, let's say P is a party which has does not have a witness, it can send an arbitrary string. And this proof might get accepted if the adversary ha...
I was told that you can determine the private key of an RSA encryption with the public key. I thought the point of a public key was to avoid letting people find the private key, but anyway, they said I could find it by simply factoring the public key modulus? Were they joshing me or can it be done? If so, how would I d...
I am working on a web app with an integrated chat. All chats can only occur between two users - not more, not less. I am very concerned with security, so I would like to encrypt all chat messages with end to end encryption. My favored protocol so far is the Signal protocol. However, the problem of web apps is that it's...
Lets suppose we have a communication protocol given where messages $(1)$ and $(2)$ are send over an unsecure network. There are some prerequisites like distributed certificates etc., but they should not matter for this question). Message (1) is send as plaintext from $A$ to $B$ and does contain the identity of $A$. Pa...
I am working on an efficient mental poker framework. I have implemented a functional and secure commutative encryption scheme based on ElGamal as described in: http://groups.csail.mit.edu/cis/theses/weis-phd-thesis.pdf However, shuffling and dealing an entire deck is causing slowdown as the number of players involved ...
Lets assume there is a guy called Ben, he contacts some server for a ticket number and the server returns a random number to him. Ben then signs that number and sends it back to the server, which checks if its valid or not and accepts Ben's connection if it is. Assuming Ben then signs and sends emails on this server us...
I try implement Shamir Secret Sharing. In this video: https://www.youtube.com/watch?v=j7Ngtl1cCpY is example. But for another three share holders is can't reconstruction secrete. For example: a) a(1) = 15 a(2) = 6 a(4) = 10 b) a(1) = 15 a(2) = 6 a(5) = 6
In regular machine learning (ML) applications, usually an accuracy of greater than 95% is desired. In an ideal TRNG/PUF applications, unpredictable behavior (50% accuracy with ML models) is desired. How do we define the predictability in these applications? For example, is 60% predictable TRNG/PUF still a good one? I...
Does deriving the public key from an RSA private key always yield the same result? And if so, does this generally apply to all asymmetric cryptosystems?
I need an encryption algorithm that would be secure enough to store credit card data. So it should be reasonably secure. Here's what I've come up with. I'd appreciate any constructive criticism. Is it secure enough? Could it be made better? public class Encryption { // Algorithm meta sizes (in bits) private con...
I have this cryptography puzzle I'm stuck on, spoilers please with hints since I want to figure this out myself. I'm given that a code in the form of x:y:z is required to access a particular goal, the example given is this: alpha:2c174:Uw9BX1U= And I'm meant to extrapolate Gamma. I think I've figured out how to get t...
I'm a bit new to cryptography and I'm trying to wrap my head around PBKDF2 and AES. As a disclaimer, this is not going to be used in an actual application, I'm just testing things locally as a fun side project. Right now what I'm trying to do is accept a password from someone to encrypt a message, and decrypt it at a l...
So for an unknown number of parties $x$, I make $x-1$ random $n$-bit strings represented by {$r_1, r_2,...,r_{x-1}$}. Where $s$ is the complete string split up between $x$ parties (yes?). I then send each party one of the fragments $s_i$, so party 1 would get $s_1$, party 2 would get $s_2$ etc. all the way through to...
Enigma's biggest flaw was that a letter could never be encrypted as itself. How much would enigma's security increase if it were possible that a letter could be encrypted as itself? I know that would void the method used by Turing and co. Please give as much detail as possible in answers. EDIT: clarifying improvement T...
In an article about NIST Post-quantum Standardization project I read about the security criteria of the proposed schemes and there was this table (Level I lowest security, level V highest): Level I: At least as hard to break as AES-128 (exhaustive key search) Level II: At least as hard to break as SHA-256 (collision ...
I hope you can help me understand the issue. I know creating my own encryption is not a thing which you should do, but I did this simple "encryption" a long time ago and discussed it with my teacher. He said that it is weak and should not be used in production, but he couldn't really explain why (or at least I didn't g...
I use Sagemath's built-in function discrete_log() to solve ECDLP and according to the documentation it uses Pohling-Hellman algorithm to solve an ECDLP. This is the case for my EC: P-order => 176648753626148987385153422443570230330 Q-order() => 2 The P-order has these prime factors: 2 * 3 * 5 * 5888291787538299579505...
AES is the gold standard for symmetric encryption. It is highly trusted and highly secure. Do any other symmetric ciphers - besides OTP - come close to AES's usability, security, trust-ability?
I have two different ciphertexts $c_1$ and $c_2$, and two different public keys that share the same modulus such that $e_1 \neq e_2$ but $n_1 = n_2$. What attack can I use to recover the private keys? Common modulus attack works only if $c_1 = c_2$, doesn't it?
Apart from bitcoins and altcoins, are there any other virtual currencies (like game currencies, gift cards or coupons) that include cryptography in their algorithm?
I know that a 128 bit key for AES yields a (around?) 128 bit of security. That means the best attack against the AES scheme is as strong as just brute forcing the key? What is the intuitively reasoning for this fact? I think there are mathematical structure in place that should help to find the key easier... In fact ...
I know in great (great great great) detail about how they cracked enigma during the second world war. Looking into it, I decided to have a crack at breaking it. I've come apon a single problem with my (theoretical) attack(s) - the most efficient way to crack plugboard settings. So, is there an attack that is more effic...
When reading ''Algebraic Cryptanalysis'' by Gregory V. Bard, Springer Editions, I got confused by this sentence: Suppose there were three naïve Cryptography students, who choose to use 3-DES iterated roughly one million times, because they are told that this will slow down a brute force attacker by a factor of one mil...
I'd like to know what is the maximum bits of the finite field that we can solve the ECDLP in a "regular" computer in trivial time. Is there any recent data about this?
It is known that the "xz" compression format embeds a checksum in the compressed file to verify integrity during decompression or standalone testing. The algorithm of the checksum can be one of: CRC32, CRC64, and SHA256, and the default is CRC64. Now, we put an "xz" file into a XTS-encrypted disk image. The XTS mode i...
Is there any quantum resistant public key cryptography with similar properties of elliptic curves? Assuming lowercase for scalars and uppercase for points. The properties I'm interested are: Reusing the same public key. Given $k = a + b$ then $k \times G = (a + b) \times G$ Distributive Scalars: $(a + b) \times G = a ...
In this paper (Section 2.3.1, Pg.5), I came across the left_encode and right_encode functions, and I have some questions about the functions: What is meant by the base256 encoding of an integer? Do $x_1,x_2,\ldots,x_n$ all contain the same bytes, or do they contain different bytes split across them? Does enc8 effectiv...
I'm curious if there's a cryptographic (or mathematical) technique for key stretching that allows someone with a secret to quickly derive the final key, requires a deterministic number of rounds for stretching (ie is not probabilistic) for someone that does not have the secret. Does such a thing exist? For context,...
I know you cannot find $b$ if you are given $B$ and $G$, where $B = [b]G$, but can you find $G$ given $b$ and $B$?
Is there anything wrong with this key-check value scheme? This question is a follow-up to an earlier question of mine. In summary, I want to devise a key-check value scheme that will enable my decryption function, when given a key K and a cyphertext C, to determine whether K is actually the key used to generate C, and...
I'm making backups of compressed data (using ZPAQ), some compressed archives are large (50 GiB) I was just going to use sha3sum -a 512, for example: sha3sum -a 512 "Total_DOS_Collection-RELEASE#17-[1981-1995].zpaq" Then storing the value and later periodically checking if the value of the backup is still the same Then...
LastPass encryption scheme is recently changed to use more PBKDF2 rounds, specifically 100100. This seems like a really weird number choose. From what I understand brute force time scales linearly with rounds because more rounds simply mean that each hash takes longer/more memory to compute. Being just over 100k, it fe...
I encountered a scheme where a hash of a message was used to encrypt the same message: result = Encrypt(message=m, key=hash(m)) Specifically: result = AES-256-CBC(message=random(1..2^132), key=SHA3(message)) Is it possible for an adversary to decrypt the message if he knows the result?
Google announced a breakthrough on the way to building usable and useful quantum computers. Since I'm not a cryptographer, I wanted to ask when quantum computers will be able to break the crypto algorithms used today and whether this breakthrough has significantly changed the predictions. Also, when will good post-quan...
I'm looking for a solution to protect a message, such that both password1 (usually given to trusted person #1) and password2 (given to trusted person #2) are required to decrypt the message. Thus, person #1 alone or person #2 alone can't decrypt the message. A solution seems to be given by Shamir's Secret Sharing (usin...
Given the following (using additive notation): $G$ - generator of an elliptic curve group of order $q$ $s$ - secret drawn uniformly from the distribution $1..q$ $k$ and $K$ - a private public keypair $E$ - an encryption of $s$ under $K$ $C$ - a commitment to $s$ such that $C = sG$. Note that it's important that $C$ ...
I have a ciphertext $C$ encrypted with public key $pub_C$, which contains ciphertext $B$ and $pub_B$, $$C= E_{pub_C}(B\mathbin\|pub_B)$$ Ciphertext $B$ is encrypted with $pub_B$ and contains $pub_A$ only. $$ B = E_{pub_B}(pub_A) $$ I already factorized $pub_C$ with Fermat obtaining ciphertext $B$ and $pub_B$ by decry...
At the beginning of this year, the CAESAR competition published the final portfolio for authenticated encryption algorithms. I'm not a cryptographer and when I look at other applications, almost always AES-GCM or ChaCha20-Poly1305 is used for authenticated encryption. So, I wonder why that is. Are the new CAESAR algori...
I have searched for my question but I didn't find any relevant answer to my situation. I guess maybe it is too easy but I am a newbie in crypto and I can't figure out the answer. Here is the exercise: An attacker mounts a partial key recovery attack on a cipher with a 128-bit key and manages to find a system of $k$ in...
Assume that a prover $P$, has previously obtained a signature $\sigma$ on a value $x$ from a verifier $V$. At a later stage, $P$ produces a Pedersen commitment $C$, to this value: $C = g^x h^r$ I'm looking for a construction where $P$ can prove to $V$, in zero-knowledge, that they know that $C$ has been opened as well ...
Does there exist any hashing function that has a different output for all of the messages? For example, let's say we have the function $H_{256}(x)$ Where $H$ is a 256 bit digest. Is it possible to construct $H$ so that it has a different output for every combination from $0$ to $(2^{256}-1)$? EDIT: what I mean is, if y...
I was learning about the classical ciphers and was looking up the methods to break them without the keywords and when I searched up "cryptanalysis of the trifid cipher" I couldn't find anything. I would be greatful for any help.(Find the outline of what the trifid cipher is here if you are unaware what it is)
In many cases when cryptographic algorithms are published the paper also provides a set of test vectors that can be used by developers to verify their implementations. For historic ciphers such as vigenere or ceasar there of course are no official papers. Is there any sort of "offical" test vector/KAT that is commonly ...
What is the difference between; pseudorandom permutation pseudorandom function block cipher? Very confused with the 3 terms and I am not good at advanced math. Can someone explain in plain word?
I'm trying to use code from "Easy ECC" package (a github project), for ECDSA-verifying a signature. The problem I'm facing is that the API assumes a public key length of N+1, which is different than NIST test vectors, where the public key is composed of 2 components (Qx, Qy) which are N bytes each. (N is the number of ...
When using the MAC-then-Encrypt composition, would using the same key for the HMAC in each different message be insecure?
I want to see a bit-sliced implementation of 5-bit and 6-bit S-Boxes of FIDES or, at least, a representation of these two functions in algebraic normal form. Where can I find it?
In RFC 8017 modBits is the length in bits of the RSA modulus n I am using 2048 RSA key modBits = 2048? modBits = 2048 % n? lets say n = 10 decimal = 1010 binary then modBits = 4? in my 2048 RSA key DER file n uses 257 bytes then modBits = 257 *8 ? which modBits = ... is true?
For VPNs which only connect to the greater internet (as opposed to a VPN for accessing a private network), it is only necessary for the server to know that the client is a paying customer. It doesn't need to know which customer. How could such a system be made? One method is to use Chaum's digital cash method, but have...
I am completely noob in terms of cryptography and security. So I decided AES Cipher for encrypting my data. I pad my input data String with blank white spaces to fit it in multiples of my cipher blocksize. So "Hello world" becomes "Helo world " But is it the right way ? Can some body crack my key, by ...
I'm reading Cryptography And Network Security of William Stallings. In the SHA-512 section it is said that there is a 512-bit buffer is used to hold the intermediate and final result and every 64-bit obtained somehow (obtained by taking the first sixty-four bits of the fractional parts of the square roots of the first ...
I'm having trouble understanding how the existence of a MAC implies the existence of an OWF. If the MAC protocol is $(\operatorname{Gen}, \operatorname{MAC}, \operatorname{Ver})$ such that for any adversary $\mathcal{A}$, \begin{gather*} \underset{k \sim \operatorname{Gen}(1^n)}\Pr[\operatorname{Ver}(k, \operatorname{M...
I am a software developer, not a cryptologist. I like the idea of perfect secrecy and would like to use a one-time pad (OTP) to encrypt/decrypt files up to, say, 50Mb. Is there a way that I can use random number generators and seeds to do this, rather than creating the (very large) pad in advance? For example, if I us...
My question is about security defined through space complexity. Suppose I have an encryption function $C=E(K,P)$ for which it can be proved (algebraically) that given $P,C,$ the possible keys which match the equation belongs to a set $S(P,C)$ of exponential size but $$|S(P,C)|\ll O(2^{\ell(K)})$$ where $\ell$ is the ke...
If a PPT adversary can influence the key of a MAC function, is it still secure? For example, if we define $f$ as follow: $f(r,x) = HMAC_{(k\oplus r)}$(x) If the adversary has oracle access to $f$, how likely he can predict the key $k$? For respecting the persons who have answered the above question, I do not change i...
For example AES-128 starting with a 128-bit message $m_0$ and static 128 key $k$ $AES128(m_0,k)\rightarrow c_0$ $c_0\rightarrow m_1$ $AES128(m_1,k)\rightarrow c_1$ $c_1\rightarrow m_2$ ... continue until $m_i$ is equal to any $m_j, j<i$ The period length would be $l = i-j$ Any theory about how big that $l$ will be?...
Knowing all AES parameters (including the key k) with $AES(m_0,k)\rightarrow c_0$ $c_0\rightarrow m_1$ $AES(m_1,k)\rightarrow c_1$ $c_1\rightarrow m_2$ ... $AES(m_{n-1},k)\rightarrow c_{n-1}$ $c_{n-1}\rightarrow m_n$ Is there any (much) faster way to compute $m_n$? (instead of computing AES $n$ times) Or compute $n$ f...
We know hash-based signatures (Winternitz signature, HORS(T) signature) that are quantum-safe and efficient. They can be stateful or stateless, one-time or multiple-time. But why are they not widely used in practice? Or maybe they are, please tell me some applications, advantages and disadvantages.
I had an idea of creating a pseudo-random binary sequence with that code: import random as rd p=[] k=10**6 for i in range(k): p.append(rd.getrandbits(1)) s='' for i in p: s+=str(i) a=p.count(0) b=p.count(1) f = open('s.txt', 'w') f.write(s) f.close() And on the stage of testing it with NIST tests there came a que...
I know that In cryptography, the linearization attack is a method of cryptanalysis for block ciphers I am looking for an example of linearization attack couldn't find it online Could anyone please explain it with an example?
If I want to encrypt some payload with AES-GCM, with the Web Cryptography API, how resistant would this be against side channel attacks?
As a person working on the physics perspective of quantum communication, I understand the process upto which the quantum key is shared securely. What happens after this process to send message bits? The literature that I've come across talk about encryption and decryption algorithms and not anything further in detail. ...
Consider the following Alice and Bob agree to an encyption system based on a solution to a complex chemical simulation Alice announces publicly that her "key" is the chemical tryptophan. Therefore any solutions with tryptophan as an input belong to Alice. A public distributed ledger exists. Alice publishes her tryptop...
My question is about symmetric randomized encryption. Let c=E(k,m,r) be a randomized block encryption function where r denotes a random input chosen for each message block m. k and c denote the symmetric key and ciphertext respectively. If E has indistinguishability of m0, m1 for any chosen plaintexts by an adversary g...
I've been reading about side-channel attacks on Wikipedia, and it seems that some of these can only be executed on the victim's computer. (I am specifically asking about the side-channel attacks listed on the Wikipedia page and any more that are theoretically possible) What would an attacker need to execute each side c...
Does an information theoretically secure hash function exist? (By exist I mean is discovered/invented and implemented, not whether it could exist.)
This is related to an earlier question, Is it possible to use an algorithm to generate an OTP? I have two machines: A, and B. A is connected to the internet and files are uploaded regularly. B is air-gapped. When files are uploaded to A, I want to encrypt and store them in the most secure way possible. They will the...
Would it be possible to create a program with which to create a cryptographic algorithm (i.e. encryption or hash) using well-known elements of other algorithms in the same way that algorithms "reuse" systems such as Feistel's structure? That is, eventually decide to use an algorithm that combines the Rijndael KeySchedu...
Please could someone kindly give an example of McEliece cryptosystem with a detailed explanation, most especially, the decoding aspect
I have implemented signature scheme 2 from ISO/IEC 9796-2 in C using OpenSSL for the underlying crypto operations. To generate the message representative (F in the standard), I just call PKCS1_MGF1() (defined here), and then XOR that to the data to be signed, excluding the hash and the trailer, as the standard says. Th...
AES-XTS does not guarantee data integrity, like AES-GCM for instance. So, in order to support data integrity it is necessary to add some MAC functionality to it. However, adding an independent MAC, for instance like HMAC, requires additional calculations over the whole encrypted block. Is there a standard way to calcul...
If I have no knowledge of the inner workings of a function, (i.e. a black box function) is there a way to make it side-channel attack resistant? (For reference, I'm working with a JavaScript encryption library)
I have the values of RSA public exponent $e$, the secret exponent $d$ and the modulus $n$. How can I create (for example using openssl) a self-signed certificate using the RSA key $(n,d), (n,e)$? Is it even possible? Second question: Is it possible to get the factors of $n$ from $(n,d), (n,e)$?
In a comment on this answer, Cort Ammon states I have heard interesting solutions to these issues involving encrypting something with a proper tested algorithm first (not second), and then encrypting it with your home brew solution with an unrelated key. It seems legit, but I can't actually claim I've analyzed that pa...
Let $E$ be a supersingular elliptic curve over $\mathbb{F}_{p^2}$, where $p = \ell_A^{e_A} \ell_B^{e_B} f \pm 1$ for some primes $\ell_A, \ell_B$. Let $R \in E[\ell_A^{e_A}]$ be a point of order $\ell_A^{e_A}$ and suppose $\phi:E \to E' = E/\langle R \rangle$ is an isogeny with kernel $\langle R \rangle$. Let $\widehat...
In order to use RSA accumulator the elements must be primes. Is there examples of collision resistant hash functions with prime domain?
Every now and then, we read that some hashing function has been weakened or broken, but we almost never hear this for asymmetric cryptosystems like RSA or ECC. That's because while asymmetric encryption uses mathematical impossibilities (discrete logarithm or prime factorization computation in polynomial time), hashing...
I was working on this project where I needed an RSA key, and I wondered if there was and more efficient way of doing $g^a \bmod n$ other than calculating $g^a$ and then finding the remainder when you divide?
During a security audit, the guy said our cryptosystem is vulnerable to known-plaintext attacks. He said that's because «the implementation uses a crypto_stream_xor() approach» (from libsodium). That's way above my skill, and I did not find anything relevant so far so I'm trying to understand if that's really a problem...
my PC found a factor for (2^2048)-1 in under a second...so does that make RSA-2048 less secure right? i used prime 95. and actually i am kinda curious how it found a factor so fast? i can even factor 2^131072 in less than 5 minutes..?
Say I want to exchange a secret with someone, but I only get to send one message to the other person, and then we encrypt with that secret. Diffie-Hellman and ECDH require multiple messages to be sent back and forth to get a shared secret. Is there a key exchange that requires just one message to be sent from one party...
I am using HMAC-SHA256 with a 128-bit key. Assume my key generator leaks some information to an adversary. Hence, the adversary can predict the key with probability $\alpha$. Can I say that the adversary can forge a valid (message,tag) pair with probability $\alpha$?
I am writing a python program for the Enigma machine. I know what the ground setting (Grundstellung) is but I don't know the difference between ground setting and ring setting. What's different between ground setting and ring set in the Enigma machine?
At first glance: Assuming that the output of the password hashing function is large enough, quantum computers should have no effect on password encryption as on symmetric cryptography in general. Is that correct? More precisely: Grover's search invokes an oracle instead of searching a dataset. Does this mean that ...
I've been reading up on Yubico's implementation of U2F. I am confused on the purpose of the message authentication code (MAC). It prevents an attacker from providing a key handle (particularly a nonce) that wasn’t generated by the U2F device. I get that. What would an attack involving changing the nonce look like? Sinc...
I'm reading a book on cryptography and it mentions the Viterbi algorithm being used to decrypt Vernam cipher if the same key is used multiple times. According to the book the Viterbi algorithm takes a weighted directed graph whose edges are labelled by letters and the weights correspond to transition probabilities. Giv...
I have this question I am trying to figure out the answer about RSA. I'd be grateful if someone could actually help me understand how the procedure would work. I am new to cryptography and with all the maths in it, I am barely understanding it. Assuming that we have a sender A and 2 recipients B and C. This sender want...
Could someone point me to the paper/reference where the following variant of q-strong Bilinear Diffie-Hellman assumption was used? Given $s \in \mathbb{Z}_p^*$ and $g, g^{\frac{1}{s}}, g^{s}, g^{s^2}, \ldots, g^{s^q}$ it is difficult to compute $g^{\frac{1}{s + c}}$ for $c \in \mathbb{Z}_p^*\setminus \{-s\}$. Essential...
Assume we are using HMAC-SHA-256 with 128-bit key for authenticating our messages, and an adversary has eavesdropped $n$ (message, tag) pairs. If the adversary wants to forge a tag for a message $m'$, (I think) he has two options: Output a random number; Output one of the eavesdropped tags I think the probability o...
Is it possible to device lightweight (i.e. without asymmetric crypto and PKI; and without third party Trent) provably secure (in the exact security sense) scheme? Were there any attempts? Is it possible to make entity authentication using only one pre-shared secret key without MitM attacks? Some remarks. By exact secu...
If I want to verify a public key (be it RSA, PGP, etc.) with another client over the Internet only, what are some viable out-of-bound channels for verification? Which channels have been used in practice and worked?
I am trying to check the part where messages are both encrypted and signed. But what is the difference between a message which looks like this -----BEGIN PGP MESSAGE----- Version: GnuPG v2 hQEMA40Tbs69jxZxAQf/QfWUH8waN2CFAbn4bWlORERoaL7Zpm95WeDPcwJDObMt E7hW+ERITJ0gakacppZuVlbHTPT4DuMpDsT1tZzk1ZfO638Jias5WyVeF9g8E3tG ...
Provided some modulus for RSA 2048, is there a way I could look up if the modulus and their factors exists online?
What is a good way of doing this? Practical and Secure. This is for a browser environment. For example, let's say there are a few 100 independent messages of about 100 characters each that you want to send to the server independently and in an arbitrary order and you want to encrypt them with the same key before they a...
Could someone please give a walkthrough of how this works: Decrypting a vigenere cipher with a reused one-time pad. It was never fully answered with the example given in the comment. e.g Plaintext 1 - apples Plaintext 2 - orange Key : fruits They are all 6 letters. If 'fruits' was used to encrypt both 'apples' and 'ora...
I hope somebody can help me to find out how DES P box has designed. I am doing DES by hand so I want to know how these numbers are arranged?