instruction
stringlengths
15
30k
Is it secure to encrypt random key with block cipher in ECB mode?
The RSA private-key operation (used for decryption and signature generation) amounts to solving for $x$ the equation $y\equiv x^e\pmod N$, knowing $y$, the factorization of the public modulus $N$ into $u\ge2$ distinct primes $N=r_1\dots r_u$, public exponent $e$ such that $\gcd(e,r_i-1)\ne1$, and that $0\le x<N$. Fo...
The RSA private-key operation (used for decryption and signature generation) amounts to solving for $x$ the equation $y\equiv x^e\pmod N$, knowing $y$, the factorization of the public modulus $N$ into $u\ge2$ distinct primes $N=r_1\dots r_u$, public exponent $e$ such that $\gcd(e,r_i-1)\ne1$, and that $0\le x<N$. Fo...
How do you know that the message will not be replayed? Do the data contain a timestamp? If not then add it. In principle, since I presume that your messages are structured even if you use the first version (with timestamps) then you should be ok. Please also be careful how you encode the data, do not use the by the ...
I have a _Luna G5 Safenet HSM_ and I want to encrypt a text file containing `testtest` with `3DES-ECB` algorithm. So in the first step I generate a `3DES` key on the HSM: A view of the key generator tool: Select type of key to generate [ 1] DES [ 2] DES2 [ 3] DES3 [ 5] CAST3 [ 6] ...
I wish to send some small data that RSA alone can encrypt, and I send a shared secret along with it. A --> B ; RSA(data||shared_secret) // B will verify the shared_secred and authenticate A; vs A --> B ; RSA(data||shared_secret) || SHA-256(data||shared_secret) Will verifying the shared secret be enough for...
I wish to send some small data that RSA alone can encrypt, and I send a shared secret along with it. A --> B ; RSA(data||shared_secret) // B will verify the shared_secred and authenticate A; vs A --> B ; RSA(data||shared_secret) || SHA-256(data||shared_secret) RSA is RSA-OEAP, not something home grown. ...
I am trying to implement Authenticated Encryption algorithms using CUDA. Most of Authenticated Encryption algorithms have short message length like 64, 254..., 4094 (Byte). these message lengths are very short and their Enc/Dec times are very small. how should i test speed of the algorithms whether they are paral...
How to test the speed of an Authenticated Encryption algorithm?
I have to derive master key from N secret key. With the help of master key, i can collect all the secret keys which is used to derive master key. key1, key2,..keyN ==> **single master key** and **single master key** ==> key1, key2,..keyN is this even possible??
Let me try to provide an answer for your question (despite the answers in the comment section). Some research showed that a recently discovered [vulnerability][1] allowed to extract the keys from SafeNet HSM (which the Luna G5 is). Therefore it should under normal circumstances NOT be possible to extract any private ke...
I am trying to implement Authenticated Encryption algorithms using CUDA. Most of Authenticated Encryption algorithms have short message length like 64, 254..., 4094 (Byte). these message lengths are very short and their Enc/Dec times are very small. I have two questions: 1-how should i test speed of the algori...
I am trying to implement Authenticated Encryption algorithms using CUDA. Most of Authenticated Encryption algorithms have short message length like 64, 254..., 4094 (Byte). these message lengths are very short and their Enc/Dec times are very small. consider an Intel-corei5-3337U ~1.80GHz CPU , and an algorithm...
In a threshold cryptosystem, is there any guarantee that all $m$ peers participating in retrieving a plain-text will _all_ retrieve it? If not, is it possible to provide such a guarantee? For instance if the $m$ peers are hostile to each other, is there a way to either have none of them get the plain text, or all of...
Does threshold crypto (m-of-n) guarantee that m peers discover the plain text?
I am studying the theory of authenticated data structure, like Merkle Tree and I have a doubt: why use them? I explain better: why to be sure, for example, that a cloud provider didn't modify my files I have to ask for a particular data block, and the cloud answers me with a hash path from the node to the root to auth...
Zhe Liu, Johann Großschädl, and Ilya Kizhvatov. ["Efficient and Side-Channel Resistant RSA Implementation for 8-bit AVR Microcontrollers"](http://www.caad.arch.ethz.ch/noolab/files/external/conferences/IoT2010_proceedings/pdf/WS1/WS1_6.%20seciot2010_submission_12_final_v0.pdf) describes a fast implementation, but only ...
Is there a fast implementation of RSA for Microcontrollers?
As a follow up to the Q/A session: https://crypto.stackexchange.com/questions/29943/small-quantum-signatures-reality-check-needed/30018#30018 <br> I have implemented the discussed idea for a new short-quantum-safe signature system using fast-forwarding hash. It creates 32 byte public keys and 129 byte signatures. ...
if two communicating parties share a (symmetric) session key, k. When one of the party wants to send a message 'm' to other, is it okay use {m}k as a digital signature?
can session key be be used as digital signature?
I've read Intel's [The Difference Between RDRAND and RDSEED](https://software.intel.com/en-us/blogs/2012/11/17/the-difference-between-rdrand-and-rdseed) and [Intel Digital Random Number Generator (DRNG) Software Implementation Guide](https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-s...
This December, $N$ friends play [secret santa][1]: they select a random permutation $\sigma$ of $N$ (without fixed point). For Santa Claus, everyone has to bring a gift to the next person in the permutation. To preserve the magical spirit of the game, each participant should only know the strict necessary (i.e. their i...
I wish to send some small data that RSA alone can encrypt, and I send a shared secret along with it. A --> B ; RSA(data||shared_secret) // B will verify the shared_secred and authenticate A; vs A --> B ; RSA(data||shared_secret) || SHA-256(data||shared_secret) RSA is RSA-OEAP, not something home gr...
When they write *“well-typed”*, they’re simply stating that the process $P$ is well-typed in context, or type environment. (Where the type environment contains a set of type assumptions occurring in $P$.) Keeping it simple: you can think of the term as a kind of classification. The term origins in [Type Theory](http...
How to store keypair generated by RSA is a textfile?
The RSA private-key operation (used for decryption and signature generation) amounts to solving for $x$ the equation $y\equiv x^e\pmod N$, knowing $y$, the factorization of the public modulus $N$ into $u\ge2$ distinct primes $N=r_1\dots r_u$, public exponent $e$ such that $\gcd(e,r_i-1)\ne1$, and that $0\le x<N$. Fo...
The RSA private-key operation (used for decryption and signature generation) amounts to solving for $x$ the equation $y\equiv x^e\pmod N$, knowing $y$, the factorization of the public modulus $N$ into $u\ge2$ distinct primes $N=r_1\dots r_u$, public exponent $e$ such that $\gcd(e,r_i-1)\ne1$, and that $0\le x<N$. Fo...
If we consider an RSA modulus $N$ of $n$ bits ($n=2048$ in the question) product of $k$ primes of about $n/k$ bits, how high can be $k$ without loosing security? That's [a problem studied even before Multiprime-RSA was named][1], with no definitive answer other than: **we can't err on the unsafe side with $k=2$**. #...
Multi-prime RSA is now a well known technique (described [here][1]): it uses $k>2$ distinct secret prime factors in the public RSA modulus, with the advantage that, using the [CRT][2], we can gain a speed boost in private-key operation, with little (conjectured) reduction in security for small-enough $k$; the effort sa...
The RSA private-key operation (used for decryption and signature generation) amounts to solving for $x$ the equation $y\equiv x^e\pmod N$, knowing $y$, the factorization of the public modulus $N$ into $k\ge2$ distinct primes $N=r_1\dots r_k$, public exponent $e$ such that $\gcd(e,r_i-1)\ne1$, and that $0\le x<N$. Fo...
Suppose that attacker creates domain parameters $(p,q,g)$ where $q$ is not prime number (but $q$ still divides $p-1$) and that signer generates new key pair using these domain parameters. How exactly can an attacker take advantage of this situation?
I am designing protocol to share a random generated *n* long password between *k* parties using Shamir's Secret Sharing. I know that share alone does not reveal much information about the original password to the attacker except for the size of password. My solution now is to extend each password to 512 bits using cons...
How secure is Shamir's Secret Sharing for password sharing when attacker has t-1 shares?
This December, $N$ friends play [secret santa][1]: they select a random permutation $\sigma$ of $N$ (without fixed point). For Santa Claus, everyone has to bring a gift to the next person in the permutation. To preserve the magical spirit of the game, each participant should only know the strict necessary (i.e. their i...
First let me be clear upfront that am not Crypto expert. I'm having a problem where I will have to use NFC card. Now given the limitation of NFC cards memory sizes, I will need to constraint my system to generate encoded data up to X amount of character. Is there a way to limit character of AES encrypted data to not...
I am trying to use Intel's optimized AES-128-GCM implementation (from the Intel white paper “Fast Multi-buffer IPsec Implementations on Intel Architecture Processors”, you can find the code [here](https://github.com/lukego/intel-ipsec/tree/4d7b9efcd141b3274ea71f921914773cd77a0590/code)). The [aesni_precomp_*](https:...
How to store keypair generated by RSA in a textfile?
What effect, if any, does the salt have on the three types of hashing attacks?
I was doing research on this attack and I am wondering why always Diffie Hellman is associated with such an attack? Aren't other public key cryptography schemes vulnerable to the same kind of attack? To be more specific is RSA vulnerable to such kind of attack? If so which versions and how can that be carried out?
What is the likelihood of 2 bcrypt hashes colliding if they use the same work-factor and input? Are bcrypt's salts large enough to prevent this from happening?
Bcrypt collission probabilities assuming same password and work factor?
I was doing research on this attack and I am wondering, why is Diffie-Hellman always <br> associated with such an attack? ​ Aren't other public key cryptography schemes vulnerable <br> to the same kind of attack? ​ To be more specific, is RSA vulnerable to such an attack? <br> If so, which versions and how can th...
This problem is about setting up cryptographic keys on an IoT device. I don't want my devices to be set up with any cryptographic keys pre-baked, but actual communication have to be based on TLS. Now I need a way to inject an SSL certificate and its corresponding private key from the device the user is using. Can this ...
Diffie-Hellman over several non-secured HTTP requests - will it work?
Are parts of a pseudorandom string also a pseudorandom string?
> What is the likelihood of 2 bcrypt hashes colliding if they use the > same work-factor and input? You're describing this: $\tau_1,\tau_2=\text{bcrypt}(pw,cost), \Pr[\tau_1=\tau_2]$. This means that the collision probability comes down to the length of the salt. bcrypt uses 128-bit salts. So you expect to find a c...
bcrypt collision probabilities assuming same password and work factor?
You ask many questions and it is not clear to me exactly what you would like to have answered. In particular, what do you mean by: > My problem is that I couldn't find out, whether $G(k)_{0...n−1}$ can be treated exactly like $G_k$. What is $G_k$ supposed to mean here? The full output of $G(k)$? What is your defi...
You ask many questions and it is not clear to me exactly what you would like to have answered. In particular, what do you mean by: > My problem is that I couldn't find out, whether $G(k)_{0...n−1}$ can be treated exactly like $G_k$. What is $G_k$ supposed to mean here? The full output of $G(k)$? What is your defi...
I'm implementing point addition and point doubling of elliptic curve cryptography. The formula that I'm using for slope is Point addition: S = (Py-Qy)/(Px-Qx) where P and Q are the two points. Point doubling: S = ((3Px)^2+a)/2Py where P and Q are the two points and 'a' is one of the parameters of the curve. ...
How to perfrom modular division while numerator is lesser than the denominator?
I'm implementing point addition and point doubling of elliptic curve cryptography. The formula that I'm using for slope is Point addition: $S = \frac{(P_y-Q_y)}{(P_x-Q_x)}$ where $P$ and $Q$ are the two points. Point doubling: $S = \frac{(3P_x)^2+a}{2P_y}$ where $P$ and $Q$ are the two points and $a$ is one of th...
I'll assume you are working modulo $p$, which most likely is some large prime. When evaluating $S={P_y-Q_y\over P_x-Q_x}$, one really is finding a representative integer of the residue class of the equivalence relation modulo $p$; that is, the result is defined within addition or subtraction of $p$ any number of times....
I'll assume we are working modulo $p$, which most likely is some large prime. When evaluating $S={P_y-Q_y\over P_x-Q_x}$, one really is finding a representative integer of the residue class of the equivalence relation modulo $p$; that is, the result is defined within addition or subtraction of $p$ any number of times. ...
I'll assume we are working modulo $p$, which most likely is some large prime. When evaluating $S={P_y-Q_y\over P_x-Q_x}$, one really is finding a representative integer of the residue class of the equivalence relation modulo $p$; that is, the result is defined within addition or subtraction of $p$ any number of times. ...
I'm implementing point addition and point doubling operations for elliptic curve cryptography. I have implemented extended euclidean algorithm to perform modulo division. It appears the that extended euclidean algorithm takes almost 90% of the computation time for the whole operation. It is slowing down the entire ...
Is there any alternative for extended euclidean algorithm to perform modulo division?
You ask many questions and it is not clear to me exactly what you would like to have answered. In particular, what do you mean by: > My problem is that I couldn't find out, whether $G(k)_{0...n−1}$ can be treated exactly like $G_k$. What is $G_k$ supposed to mean here? The full output of $G(k)$? What is your defi...
I'll assume we are working modulo $p$, which most likely is some large prime. When evaluating $S={P_y-Q_y\over P_x-Q_x}$, one really is finding a representative integer of the residue class of the equivalence relation modulo $p$; that is, the result is defined within addition or subtraction of $p$ any number of times. ...
> The adversary selects a random integer $$m \in \mathbb{Z}^*_n$$ and > computes $$c=m^2 \mod n$$. The adversary then presents *c* to A's > decryption machine, which decrypts c and returns some plaintext *c*. > Since A does not know *m*, and *m* os randomly chosen, the plaintext > *y* is not necessarily the same as...
> The adversary selects a random integer $$m \in \mathbb{Z}^*_n$$ and > computes $$c=m^2 \mod n$$. The adversary then presents *c* to A's > decryption machine, which decrypts c and returns some plaintext *c*. > Since A does not know *m*, and *m* os randomly chosen, the plaintext > *y* is not necessarily the same as...
The company I work for needs to develop a simple system where, for each client, we encrypt a small number of tokens on our server, which are then transmitted to the client. The decryption is performed by the server itself when the client transmits the tokens (thus the only machine that performs crypto is the server). ...
Is it bad design to reuse an AES key?
The company I work for needs to develop a simple system where, for each client, we encrypt a small number of tokens on our server, which are then transmitted to the client. The decryption is performed by the server itself when the client transmits the tokens (thus the only machine that performs crypto is the server). ...
I'll assume we are working modulo $p$, which most likely is some large prime. When evaluating $S={P_y-Q_y\over P_x-Q_x}$, one really is finding a representative integer of the residue class of the equivalence relation modulo $p$; that is, the result is defined within addition or subtraction of $p$ any number of times. ...
**What you didn't ask but should have.** So the IV never changes for a given client? That to me seems like the bigger issue. You should be generating an new, random IV with each encryption, and sending the IV to the client with the ciphertext. You should also add integrity protection such as an [HMAC](https://en.wik...
The company I work for needs to develop a simple system where, for each client, we encrypt a token on our server, which is then transmitted to the client. The decryption is performed by the server itself when the client transmits the token (thus the only machine that performs crypto is the server). The token is for ...
What type of encryption scheme can prevent cheating in this coin flip protocol?
The Bulletin of the Atomic Scientists recently ran an article about an alleged near miss with rockets in 1962, which raises some interesting cryptographic questions: http://thebulletin.org/okinawa-missiles-october8826 > After the usual time-check and weather update came the usual string of > code. Normally the...
First, I'd like to say: **Don't roll your own crypto.** Your first protocol is basically "your own crypto". The easiest / standard solution to this problem is to use [TLS][1]. You can use TLS (with server-authentication only) as a replacement for your first part. I'd recommend though, using [DNSSEC][2] / [DANE][3] a...
*Note: I originally posted this as an answer to [another question](http://crypto.stackexchange.com/questions/31031/what-type-of-encryption-scheme-can-prevent-cheating-in-this-coin-flip-protocol) before realizing that it was a duplicate, so I'm reporting it here.* As already noted, any scheme that lets $B$ choose $c_...
Thank you for your reply. Based on your inputs. I was investigated further, find details below Step 1) Input string for encryption is UUID format Input data = c0c6f311-a793-4d65-9374-1c0e45f5382c Length = 36 bytes Step 2) encrypt UUID with gpg command gpg --encrypt -r PublicKey c0c6f311-a793-4d65-9374-1c0...
Thank you for your reply. Based on your inputs. I was investigated further, find details below Step 1) Input string for encryption is UUID format Input data = c0c6f311-a793-4d65-9374-1c0e45f5382c Length = 36 bytes Step 2) encrypt UUID with gpg command gpg --encrypt -r PublicKey c0c6f311-a793-4d65-9374-1...
We learned in class that if Alice wants to send a small message m, such that m < N^(1/e), so we can break the system using e-th square of m^e. But what if Alice knows this flaw and decides to sent 2^100*m as her message. Is an attacker can still break the system (I assume that the attacker knows that Alice sent 2^10...
We learned in class that if Alice wants to send a small message $m$, such that $m < N^{\frac{1}{e}}$, so we can break the system using $e$-th square of $m^e$. But what if Alice knows this flaw and decides to sent $2^{100}\cdot m$ as her message. Is an attacker can still break the system (I assume that the attacker k...
2 questions about nonce usage in GCM: - Is it safe to use non-random nonce in GCM? Say I use 0x1 for m1, 0x2 for m2, so on. - How much should a nonce increased for a file? Say I use 0x1000 as a nonce to encrypt a 1000x block size file (128,000bits). Then should the next safe nonce to use for the next file be simp...
> Is it safe to use non-random nonce in GCM? Say I use 0x1 for m1, 0x2 for m2, so on. It is perfectly safe to use a non-random nonce in GCM, as long as you never reuse a nonce for two different messages. So, if you use the message count for the nonce, that's fine; if you accidentally forget that you used nonce 0x5 ...
I have two prime numbers: p = 37 q = 41 And I need to find whether any of these prime numbers, 5, 7 or 11, can be used as a valid encryption key e? My working so far: Computer their product: n = p * q = 1517 Compute Euler totient: m = (p - 1)(q - 1) = 1440 Find greatest common ...
As per my understanding, in Elliptical curve cryptography, the EC PrivateKey is nothing but a bigInteger value. If you know the curve specs and you have this private BigInteger value (which I am referring as raw private key), then you can re-create PrivateKey and use it for generating the signature. Now, my question...
Is it possible to re-generate ECPublic key from raw private key and curve params?
The Bulletin of the Atomic Scientists recently ran an article about an alleged near miss with rockets in 1962, which raises some interesting cryptographic questions: http://thebulletin.org/okinawa-missiles-october8826 > After the usual time-check and weather update came the usual string of > code. Normally the...
RSA Keys as block system cipher it's strong but noway using RSA Keys for stream system cipher Like RC4. So how much strong encryption when we using RSA Keys for RC4 in stream encryption?
How much strong is hyper-cipher(RSA - RC4)?
Andy is going to connect to a server Selma over TLS. Later, Andy would like to be able to publish everything (the ciphertexts, the plaintexts, all his keys) and prove to a mediator what data he sent to Selma over TLS; or prove what data Selma sent to him over TLS. Is there any way I can do this? More specifically:...
Hi my name is Steve and the RSA-2048 Crypto Ransom Virus has devastated me, I tried the backup method, the previous version, the Shadow Explorer, it deleted all my restore points, Its took out 5 HDs and my USB pen that happened to be plugged in, everything is encrypted, all my kids pictures and videos, spreadsheets, PD...
I am working on this exercise but can't work out the answer to the question b. I have solved the question a) by decrypting the cyphertext C = 2 using the formula: M = C^d mod n = 2^17 mod 21 = 11 Alice and Bob agree to communicate using the RSA cryptosystem. Alice has a private key (n = 21, d = 17) and a public...
My idea is to generate a RSA 2048 bit key and use RC4 with the private RSA key to encrypt a stream of data. RC4 is weak because RC4 keys are small, 256-bit. But when we use RC4 with private RSA 2048 key, how much stronger will it be?
How much stronger is RC4 if it is keyed with an RSA private key?
The RSA-2048 Crypto Ransom Virus has devastated me, I tried the backup method, the previous version, the Shadow Explorer, it deleted all my restore points, Its took out 5 HDs and my USB pen that happened to be plugged in, everything is encrypted, all my kids pictures and videos, spreadsheets, PDF's, Music and more. I n...
Structure on an introductory course on cryptography?
Structure for an introductory course on cryptography?
I am working on this exercise but can't work out the answer to the question b. I have solved the question a) by decrypting the ciphertext C = 2 using the formula: M = C<sup>d</sup> mod n = 2<sup>17</sup> mod 21 = 11 Alice and Bob agree to communicate using the RSA cryptosystem. Alice has a private key (n = 21, ...
I am working on this exercise but can't work out the answer to the question b. I have solved the question a) by decrypting the ciphertext $C = 2$ using the formula: $$ M = C^d \bmod n = 2^{17} \bmod 21 = 11 $$ > Alice and Bob agree to communicate using the RSA cryptosystem. Alice has a private key ($n = 21$, $d...
I need to calculate 256-bit hash in my code, using BLAKE2. I know I can set BLAKE2 to generate itself a 256-bits hash for any data but I´m curious to know what can be safer and faster: 1- Create the 256-bit using Blake2Config module; or 2- Truncate the normal 512-bit result getting the leftmost 32 bytes (256 b...
Blake2: truncate 512-bit hash is safer than 256-bit by Config?
My question is in Key Policy-ABE (KP-ABE), what does "Ciphertext is Labeled with set of attribute " mean?? How labeled?
Alice just generated a new pair of public and private RSA keys (pkA , skA ) = ((N, e), d) and would like to start a private conversation with Bob. How can Alice interact with Bob and exchange a symmetric key? Describe a key exchange protocol between them which is secure against an eavesdropper adversary. b) Fully ...
Consider the [DSA key generation](https://en.wikipedia.org/wiki/Digital_Signature_Algorithm#Parameter_generation): 1. A large prime $p$ is chosen; 2. A smaller modulus $q$ is chosen such that $p - 1$ is a multiple of $q$; 3. A generator $g$ s.t. $\operatorname{ord}_p(g) = q$ is chosen. My question is -- why do ...
Why is it that in DSA, the order of the subgroup, $q$, is chosen such that it divides $p - 1$?