instruction
stringlengths
15
30k
I'm reading about the broadcast encryption described in Fiat and Naor's paper, I screen grabbed the relevant part below. My question is essentially: If there's a secret: $g^{abc}$ $mod$ $A$ (where $A=PQ$ (both sufficiently large primes)) why is it that one user who knows: $g^d$ $mod$ $A$, $a$, $b$, $c$, ...
I have a system which (should) never shut down, there are keep alive messages every 30 seconds and normal traffic is very variable, might be a few KB/sec might be nothing more than the keep alive message. Normally one would create a new key when you start a new connection but since our connection could (should) be u...
my question is just for teaching/learning practice and I think it's not meaningful for the real world. I've played with openssl a lot but from my understanding it's somehow not strict in the format of the input because it's capable of understanding different format or doing some operations not transparently to the u...
###Comment### > When I do openssl rsa -in private.key -pubout I know that openssl does not compute the public key from the private but it just extracts the information that is alredy stored in the keypair I don't think it's possible (or rather, *tractable*) to *compute* one key from another, that would involve fa...
###Comment### > When I do openssl rsa -in private.key -pubout I know that openssl does not compute the public key from the private but it just extracts the information that is alredy stored in the keypair I don't think it's possible (or rather, *tractable*) to *compute* one key from another, that would involve fa...
Have you played with `OpenPGP` / `GnuPG` (aka `gpg`)? `gpg` is a command-line tool similar to `OpenSSL`, but focused on end-user encrypting / signing, rather than on server / certificates / transport layer. You might find `gpg` suitably low-level for learning about keys -- that's where I started :-P
Using [LUC RSA][1], I have a list of 8 public keys $(R_1,n_1)$ through $(R_8,n_8)$, and a list of $8$ messages $M_1\dots M_8$. The messages have all been double encrypted. However, one of the public key exponents, $n_5$, is not given. The problem is to decrypt all of the messages, and so I must also determine the valu...
Using [LUC RSA][1], I have a list of 8 public keys $(R_1,n_1)$ through $(R_8,n_8)$, and a list of $8$ messages $M_1\dots M_8$. The messages have all been double encrypted. However, one of the public key exponents, $n_5$, is not given. The problem is to decrypt all of the messages, and so I must also determine the valu...
If $p$ is prime, then $\phi(p) = p-1$; so the question is "given $k(p-1)$, can someone get a good guess of what $p$ might be?" It is unlikely that the attacker would be able to limit it to one particular value of $p$ (as there are likely to be multiple values of $p$ that are plausible), however the attacker might be a...
Is there any security compromises if the Paillier system was used to encrypt only binary message in {0, 1}? i.e., plaintexts are either 0 or 1.
Does the Paillier system remain secure if it is used to encrypt only binary values, i.e. {0, 1}?
If $p$ is prime, then $\phi(p) = p-1$; so the question is "given $k(p-1)$, can someone get a good guess of what $p$ might be?" It is unlikely that the attacker would be able to limit it to one particular value of $p$ (as there are likely to be multiple values of $p$ that are plausible), however the attacker might be a...
Suppose we have a value ```$secret``` which is a random 56-bit (7-byte) string. Suppose an adversary wishes to discover ```$secret```. The adversary cannot directly see ```$secret```, but he can see ```substr(sha1_hex("$secret $salt"), 0, 8)``` (where ```$salt``` is public -- and perhaps irrelevant to our calculation...
Suppose we have a value ```$secret``` which is a random 56-bit (7-byte) string. Suppose an adversary wishes to discover ```$secret```. The adversary cannot directly see ```$secret```, but he can see ```substr(sha1_hex("$secret $salt"), 0, 8)``` (where ```$salt``` is public -- and perhaps irrelevant to our calculation...
Using [LUC RSA](http://diamond.boisestate.edu/~liljanab/MATH308/luc_rsa.htm), I have a list of 8 public keys $(R_1,n_1)$ through $(R_8,n_8)$, and a list of $8$ messages $M_1\dots M_8$. The messages have all been double encrypted. However, one of the public key exponents, $n_5$, is not given. The problem is to decrypt ...
For example, if they somehow got a function that would churn out any arbitrary amount of primes in a row. Could they break the RSA problem then?
If someone had a list of all primes, would it be possible for them to factor any integer in polynomial time?
Help me understand the Diffie-Hellman Key Exchange From what I understand: Alice and Bob agree to a large prime number which we will call (N).**(Why does it need to be a prime number? How does the size of the number affect its security?)** They also agree on a Generator, we will call it (G) **(What's a generato...
First off, this feels like it should be a common question, so I'm sorry if I've missed an older thread. Note that in my question, I'm talking about "implementing AES" rather than "designing AES2" or something. I am of course familiar with the saying that you should "never implement your own crypto" and I've recen...
At what point can you you implement crypto algorithms?
Help me understand the Diffie-Hellman Key Exchange From what I understand: 1. Agreed upon numbers: >a. both parties agree on the value of a large prime number (N) >b. both parties agree on a generator (G) 2. Private Key is chosen (X) > a. user a chooses a private key (X) > b. user b chooses a priva...
Help me understand the Diffie-Hellman Key Exchange From what I understand: 1. Agreed upon numbers: Both parties agree on the value of a large prime number $p$ and a generator $g$. 2. The users each choose private keys; Alice chooses $a$ and Bob chooses $b$, such that $0<a,b<n$. 3. The users each calculate p...
I have the first function that generates keys from AES decryption (128-bit key). It takes `seed` as input: derived_key_1 = AES-DEC(key, seed) `seed` and `key` are both fixed values that the attacker cannot changed. Attacker knows the value of `seed`. His first goal is to get `derived_key_1`. He dooes have...
im trying to work on key agreement schemas on embeded systems. for diffie hellman, ive written a 256 bit multiplication, on AVR core it takes about 2 seconds on 1Mhz frequency, lets say my algorithm is weak and it'll work in 1/10 of this time. if we multiply the clock and say were working on 3Ghz PC, we have to exponen...
I want to encrypt very small integers in the range `0-44` using the [Paillier cryptosystem][1]. Is there a way to select `p`, `q` (`g=n+1` anyway) and mostly `r` in such a way that I can guarantee that the encrypted values are still 32-bit integers? Also, I have trouble understanding how to select `r`. According to ...
I have an RSA private key $\{d,n\}$ and a public key $\{e,n\}$, where $n$ is the modulus, and I also have the prime factors $p$ and $q$ of $n$. I want to create a PEM file containing this information, so that I can decrypt a file encrypted with the public key using OpenSSL. How can I do this?
How to create a PEM file for storing an RSA key?
1. $p$ must be a prime number to construct a cyclic group with $p-1$ valid private exponents. Using a composite number might impose security issues and possibly performance penalties. 2. The size of $p$ dictates the security as it forms the size of the field. The larger the field, the more private exponents to try. ...
I was trying to understand Bleichenbacher’s CCA attack and thought of work it out in python. Can some one throw some light on the the logic behind the oracle used to check PKCS conformation? Will a cipher's parity check yield anything useful?
How to make PKCS conformation oracle for trying Bleichenbacher’s RSA attack?
I am currently working on a python script that does image steganography, altering the least significant bit on each channel of the image. Now imagine encrypting a file with a bunch of null bytes, or if you want a more realistic scenario, text that has a lot of repeating sequences in it (whole words / characters); Analy...
If you have a TRULY random key (in binary) and you have a text (in binary) that you want to encrypt. Can you simple XOR the key and the text? Is that secure? How secure?
XOR = Best encryption?
The standard algorithm used for RSA encryption and decryption is [exponentiation by squaring](//en.wikipedia.org/wiki/Exponentiation_by_squaring). The basic idea is to write the exponent out in binary. For example, for $d = 4267793$, $$\begin{aligned} 4267793 &= 10000010001111100010001_2 \\ &= 2^{22} + 2^{16} + 2...
I have this problem: In RSA algorithm considering n=33 (module) and public esponent e=3, calculate the corresponding private key d. I know that d = e^-1 mod φ(n), φ(n) = (p – 1) (q – 1) but i don't know p and q. How can i do?? Thanks in advance for your help.
I have this problem: In RSA algorithm considering n=33 (modulus) and public exponent e=3, calculate the corresponding private exponent d. I know that $d = e^{-1} (mod ~ φ(n))$, $φ(n) = (p – 1) (q – 1)$ but I don't know p and q. How can I do this?
I have this problem: In RSA algorithm considering $n=33$ (modulus) and public exponent $e=3$, calculate the corresponding private exponent $d$. I know that $d = e^{-1} \pmod{\varphi(n)}$ and $\varphi(n) = (p – 1) (q – 1)$ but I don't know $p$ and $q$. How can I do this?
RSA: How to calculate the private exponent?
I finally found out what you're asking for: A specific (working?) *related-key attack* on AES! For this answer I changed the notation a bit: - `AES-DEC(K,P)` got converted to $D_K(P)$ - `derived_key_X` got converted to $DK_X$ - `seed` (which is known) got converted to $S_K$ - `chosen_seed` got converted...
I'm interested in the property of involution in block ciphers and how one would go about constructing one. Creating a cipher where $D_K(E_K(M))=M$ for any $M$ and $K$ isn't an obvious task and the use of round keys makes it seem like this is an impossible task without undermining the security of the thing. What is my b...
You can turn any secure $n$-bit pseudorandom function into a secure<sup>(?)</sup> reciprocal $2n$-bit block cipher by using the former in a [Feistel network](http://en.wikipedia.org/wiki/Feistel_cipher) with a palindromic key schedule. <sup>(?)</sup> I'm not certain whether the Feistel construction is weakened by a ...
im trying to work on key agreement schemas on embeded systems. for diffie hellman, ive written a 256 bit multiplication, on AVR core it takes about 2 seconds on 1Mhz frequency, lets say my algorithm is weak and it'll work in 1/10 of this time. if we multiply the clock and say were working on 3Ghz PC, we have to exponen...
I'm interested in the property of involution in block ciphers and how one would go about constructing one. Creating a cipher where $E_K(E_K(M))=M$ for any $M$ and $K$ isn't an obvious task and the use of round keys makes it seem like this is an impossible task without undermining the security of the thing. What is my b...
You can turn any secure $n$-bit pseudorandom function into a secure<sup>(?)</sup> reciprocal $2n$-bit block cipher by using the former in a [Feistel network](http://en.wikipedia.org/wiki/Feistel_cipher) of at least 4 rounds with a palindromic key schedule. <sup>(?)</sup> I'm not certain whether the Feistel construct...
*The given examples below are dummy and in English. They are mainly for place holding as this is a concept question rather specific example based* Given AES has a block size of 128 (16 letters of English) and assume I am using the 128 key version without an IV. Assume I have the plaintext `hellohowareyoutodayihop...
To prove that product holds over integers, one would start from commitments with groups of a hidden order. That is, proving party should not know order of the group, which is the case with RSA-like multiplicative group. Consider Prover responses $\rho_x = tx + \alpha_x$, $\rho_y = ty + \alpha_y$, $\rho_z = tz + \...
*The given examples below are dummy and in English. They are mainly for place holding as this is a concept question rather specific example based* Given AES has a block size of 128 bit (16 letters of English) and assume I am using the 128 bit key version without an IV. Assume I have the plaintext `hellohowareyout...
with RSA encryption, how do I find the md5sum of the private key from the public key?
Can somebody please explain how an initialization vector works. My current understanding is that it is used to prevent 2 of the same messages looking identical after encryption, but isn't this the same as what a salt does? How is it different from a salt?
how does an initialization vector work?
What are the main differences between a nonce, a key and an IV? Without any doubt the key should be kept secret. But what about the nonce and the IV? What's the main difference between them and their purposes? Is it only that, in literature and in practice, an IV is being used as "initiator" of an block cipher encrypti...
What is the main difference between a key, an IV and a nonce?
Considering an Affine Cipher in ${Z}_{26}$. I know plaintext that begin with "es" and the corrispondent ciphertext "FX". How can calculate the key??
Affine Cipher: How to calculate key?
I need to implement AES_GMAC encryption and decryption in c/c++ programming language. For the implementation, I have referred following document: http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf But It seems that it contains esoteric information specific for people with cryptog...
***Disclaimer*** <br> *Lets start of by saying, yes i know making an own protocol is bad mkay. I have discussed this (at length) with my supervisors but (they made a 'fair' point) there is no TLS implementation small enough that can fit on our devices (not much remaining code space). So here I am implementing (it hurt...
***Disclaimer*** <br> *Lets start of by saying, yes i know making an own protocol is bad mkay. I have discussed this (at length) with my supervisors but (they made a 'fair' point) there is no TLS implementation small enough that can fit on our devices (not much remaining code space). So here I am implementing (it hurt...
***Disclaimer*** <br> *Lets start of by saying, yes i know making an own protocol is bad mkay. I have discussed this (at length) with my supervisors but (they made a 'fair' point) there is no TLS implementation small enough that can fit on our devices (not much remaining code space). So here I am implementing (it hurt...
***Disclaimer*** <br> *Lets start of by saying, yes i know making an own protocol is bad mkay. I have discussed this (at length) with my supervisors but (they made a 'fair' point) there is no TLS implementation small enough that can fit on our devices (not much remaining code space). So here I am implementing (it hurt...
Can a cipher that is vulnerable to an known plaintext attack be made secure by adding an additional XOR-encryption? That is: suppose I have an (w.l.o.g. symmetric) encryption algorithm E were the attacker can retrieve the rest of the message, if he knows any part of it (but secure if he doesn't). I would try to ...
I know and I have understood the details of RSA, elliptic curve cryptography, (EC)DH and (EC)DSA. I keep reading everywhere that (if we don't consider non-deterministic computers) "ECC can achieve the same level of security as RSA, but with lower key sizes". While I can guess why this is true, how do we mathematical...
ECC vs RSA: how to compare key sizes?
I know and I have understood the details of RSA, elliptic curve cryptography, (EC)DH and (EC)DSA. I keep reading everywhere that (if we don't consider non-deterministic computers) "ECC can achieve the same level of security as RSA, but with lower key sizes". While I can guess why this is true, how do we mathematical...
Consider I have a cipher text that I know is encrypted using Affine Cipher in ${Z}_{26}$. The plain text begins with "es" and the correspondent cipher text is "FX". How can I calculate the key?
Affine Cipher: How to calculate the key?
Suppose I have a ciphertext that I know is encrypted using an affine cipher in $\mathbb{Z}_{26}$. The plaintext begins with `es` and the corresponding ciphertext is `FX`. How can I calculate the key?
As far as I understood so far, in case of using SSL certificate, server has a primary key and public key is published to all clients. so in this case when message is encrypted by public key (on client side) only the owner of private key (which is the server in this case) has ability to decrypt it. but I do not understa...
As far as I understood so far, in case of using SSL certificate, server has a primary key and public key is published to all clients. so in this case when message is encrypted by public key (on client side) only the owner of private key (which is the server in this case) has ability to decrypt it. but I do not understa...
In case of using SSL the certificate server has a primary key and a public key that is published to all clients - as far as I understood. So in this case when message is encrypted by public key (on client side) only the owner of private key (which is the server in this case) has ability to decrypt it. But I do not u...
Is HMAC-MD5 considered secure for authenticating encrypted data?
MD5 collisions have been [out for some time](http://en.wikipedia.org/wiki/MD5#Collision_vulnerabilities). In spite of this, HMAC-MD5 is [still secure for authenticating data](http://crypto.stackexchange.com/questions/9336/is-hmac-md5-considered-secure-for-authenticating-encrypted-data)<sup>1</sup>. This illustrates a s...
Is HMAC-MD5 still secure for commitment or other common uses?
Currently my knowledge about Elliptic curve is quite limited to the textbook and I don't know how a practical Elliptic curve cryptosystem works. I read an example about key exchange using Elliptic curves. And I am wondering what is the public information (key) of a practical Elliptic curve cryptosystem. First, th...
I'm trying to devise a good security scheme to protect comms over Wi-Fi. Right now, I have 2 devices that already communicate via UPnP but I need to secure this communication. I've come up with this: - Once the client sees the other host, picks a pair of **Diffie-Hellman** parameters (out of 1000 pregenerated pai...
DH with AES - is that an acceptable security scheme over UPnP?
In case of using SSL the certificate server has a primary key and a public key that is published to all clients - as far as I understood. So in this case when message is encrypted by public key (on client side) only the owner of private key (which is the server in this case) has ability to decrypt it. But I do not u...
In case of using SSL the certificate server has a primary key and a public key that is published to all clients - as far as I understood. So in this case when message is encrypted by public key (on client side) only the owner of private key (which is the server in this case) has ability to decrypt it. But I do not u...
Initially let me state that this is an atypical type of cryptographic encoding. First I break up my key into three parts $k = {W,\overrightarrow{b},\alpha}$. the $W$ is simply a $n \times n$ matrix, $\overrightarrow{b}$ is a vector of size $n$ and $\alpha$ is a scalar. My message is also a matrix with dimensions $k \t...
What both parties have: **Server**<br> Master Secret (MS)<br> Server supported versions (Svers)<br> Agreed upon version (ver) **Client**<br> Master Secret (MS)<br> Client supported versions (Cvers)<br> Agreed upon version (Ver) What I am planning on doing: Client sends `Cvers` to Server.<br> Server c...
Is what i'm trying to do safe?
Suppose I have a local file and it is encrypted with a symmetric key derived from a strong passphrase, unique salt and $x$ number of PBKDF (e.g. Scrypt) iterations. I am interested in keeping this file a secret for a very long time. Suppose the user specifies the number of iterations themselves e.g. a random number ...
Is there a tangible benefit in keeping the number of PBKDF iterations secret and not storing them with the ciphertext?
Imagine there is a protocol supporting outosurced multi party computation. There are three parties involved in the protocol: client $A$, client $B$ and a server. Client $A$ and $B$ send their private sets to the server. The server computes the private set intersection and returns it to $B$. $A$ and $B$ are honest but s...
I am kind of confused whether should a newly generated key pair be stored in a keystore or in just a normal plain text file? From what I read from online source, there are serveral explainations about what the keystore actually store. some says it stores the certificates only while some says it stores the key pai...
where should private and public keys be stored?
I'm working on implementation of keccak algorithm and have one problem. Tell me please, takeing an example "test": will state (before block permutations, but after padding - pad10*1) look like this: {80...0 0 0 0 0} {0 0 0 174736574 0} {0 0 0 0 0} {0 0 0 0 0} {0 0 0 0 0} or maybe like this: {80...0 0 0 0 0} {0...
I want to get a group element $h$ on the elliptic curve secp256k1. The important thing is that no one should know the discrete logarithm of $h$ with respect to $g$. That is, $h$ should be created from a public beacon and not by exponentiating $g$. What's the best way to do this?
I'm working on implementation of keccak algorithm and have one problem. Tell me please, takeing an example "test": will state (before block permutations, but after padding - pad10*1) look like this: {80...0 0 0 0 0} {0 0 0 174736574 0} {0 0 0 0 0} {0 0 0 0 0} {0 0 0 0 0} or maybe like this: {80...0 0 0 0 0} {0...
Consider the following code snippet: <?php if (md5($_POST['password']) === '550b1f8802ca3d7a987fc46a2af408c3') { $_SESSION['loggedIn'] = true; } header("Location: /"); exit; If an attacker doesn't know the hash, they should still be able to leak bits of the hash via timing inform...
Timing Attacks on MD5 Hashes?
Consider the following code snippet: <?php session_start(); if (md5($_POST['password']) === '550b1f8802ca3d7a987fc46a2af408c3') { $_SESSION['loggedIn'] = true; } header("Location: /"); exit; If an attacker doesn't know the hash, they should still be able to leak bits of the ...
You really want to authenticate, what use is confidentiality if some random intruder can pretend to be either host or client, or can insert themselves in the middle of the conversation? No need to break the encryption, you'd just give away the keys. If you need to protect the data from being seen, you also need to pr...
You really want to authenticate, what use is confidentiality if some random intruder can pretend to be either host or client, or can insert themselves in the middle of the conversation? No need to break the encryption, you'd just give away the keys. If you need to protect the data from being seen, you also need to pr...
You really want to authenticate, what use is confidentiality if some random intruder can pretend to be either host or client, or can insert themselves in the middle of the conversation? No need to break the encryption, you'd just give away the keys. If you need to protect the data from being seen, you also need to pr...
I have read many pages about encryption but I am really stuck on this. For access control to a building I want to print a 10 character ascii code on a ticket (as barcode). The barcode reader (controlled by an arduino or mini pc) is not connected to the pc which creates and prints the barcodes. When both server ...
I am trying to create a secure Bluetooth Low Energy connection. The peripheral server (the main device other people would connect to) would need to service many clients (users) and due to hardware limitations, I would not be able to let the hardware manage security (essentially, it has a limit of 4 keys, i.e., 4 users)...
I need to know in an outsourced two party computation where honst $A$ and $B$ outsource their private and secure data to a malicious server, why we need to design a simulator **that interacts with an adversary** who exists in real model? See the paper cited below as an example: https://eprint.iacr.org/2011/272.pdf ...
I need to know in an outsourced two party computation where honst $A$ and $B$ outsource their private and secure data to a malicious server, why we need to design a simulator **that interacts with an adversary** who exists in real model? See the paper cited below as an example: https://eprint.iacr.org/2011/272.pd...
First of all I would like to say hello to all StackExchange users. So far I've been stalking the forum for some time, now it's time to leave the shadows. In my master thesis I'm writing about heuristic methods in cryptanalysis, etc. ant colony algorithms or genetic algorithms. So far all methods seems to be quite in...
how can i apply meet in the middle attack on 3DES algorithm and why does the literature say that 3DES is more secure than DES ?