instruction
stringlengths
15
30k
In a rolling code both the sender and the receiver always move forward in the sequence. If the sender has sent the $n$th code, then it will send the $(n+1)$th next. Contrarily, if the receiver has seen the $n$th code it will only accept the $(n+1)$th code *or some later code*. > What happens if the sender is at anot...
While thinking about [this][1] recent question about a hash-then encrypt design, I reread the MAC-encrypt vs. encrypt-MAC question and noticed [this answer][2] quoting a paper showing that MAC-then-encrypt is secure with stream ciphers, even if not generically. However, there's this attack when the MAC is determinis...
Is MAC-then-encrypt with stream ciphers secure?
Given a function $F: A \rightarrow B$ and a function $R:B \rightarrow A$, we can create a *chain* of length $k$ from a starting point $a_0$ to an end point $a_k$ using $a_i = R(F(a_{i-1}))$. A *rainbow table* for $(F, R, k)$ is a collection of chains with end points $(a_0, a_k)$ organized so that searching for chain...
I have an embedded project that requires AES, I seem to have found an AES implemtation that fits the bill here: http://www.literatecode.com/aes256 bit it does not include an IV. Are there any documents detailing the standard way to implement an IV? I looked up the FIPS 197 spec. and there is no mention of an IV.
Rather than making an overly long question even longer, I post this as an answer. As part of the update process of the French security recommendations linked in the question, I suggested (June 2013) a waver for the requirement/recommendation that $e>2^{16}$ when using a padding scheme with a security proof. It was k...
Rather than making an overly long question even longer, I post this as an answer. As part of the update process of the French security recommendations linked in the question, I suggested (June 2013) a waver for the requirement/recommendation that $e>2^{16}$ when using a padding scheme with a security proof. It was k...
Rather than making an overly long question even longer, I post this as an answer. As part of the update process of the French security recommendations linked in the question, I suggested (June 2013) a waver for the requirement/recommendation that $e>2^{16}$ when using a padding scheme with a security proof. It was k...
I have an embedded project that requires AES, I seem to have found an AES implementation that fits the bill here: http://www.literatecode.com/aes256, but it does not include an IV. Are there any documents detailing the standard way to implement an IV? I looked up the FIPS 197 spec and there is no mention of an IV. ...
Rather than making an overly long question even longer, I post this as an answer. As part of the update process of the French security recommendations linked in the question, I suggested (June 2013) a waiver for the requirement/recommendation that $e>2^{16}$ when using a padding scheme with a security proof. It was ...
I have a requirement to implement AES_CMAC as the authentication algorithm in a CMS library. I just can't seem to find the OID and the ASN.1 definition for it. I expected to see the OID under {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) aes(1)} since it appears to be a N...
Where is the OID and ASN.1 specified for AES_CMAC?
I am using a 1024-bit key and 3-DES to encrypt some data in Java. I decided to run some tests and plot some graphics to decide how to optimally pack data for its encryption (see how encryption/decryption time behave depending on the length of the plain text), so I measured the time to encrypt one thousand Strings of in...
Does 3-DES take approximately the same time to encrypt 1B and 1KB?
I am using 3-DES to encrypt some data in Java. I decided to run some tests and plot some graphics to decide how to optimally pack data for its encryption (see how encryption/decryption time behave depending on the length of the plain text), so I measured the time to encrypt one thousand Strings of incremental size (fir...
If $p$ is a big prime, and the elliptic curve $E$ is defined over $F_p$ by the equation $y^2=x^3+ax+b$ where $a,b\in F_p$. The point on $E/F_p$ together with the infinite point $\mathcal{O}$ form a group $G=\{(x,y):x,y\in F_p;(x,y)\in E/F_p\}\cup\{\mathcal{O}\}$. Then is $G$ a cyclic group? what's the order of $G$? ...
### What is Rijndael's finite field? Rijndaels finite field is $F=\mathrm{GF}(2^8)$ with minimal polynomial $f(x)=x^8 + x^4 + x^3 + x + 1$. Formally, we have $F=\mathbb F_2[x] / (f)$ but don't worry about that. So what does this mean? Well, elements of $F$ should be thought of as polynomials over $\mathbb{F}_2$, ...
I would like to generate a key which would be good enough to be used for encryption with AES in a mobile environment. My idea is to use as a seed ''random attributes'' from a mobile device. Is hashing first this seed using HMAC construction (with some salt which is also random but public) and then use a HMAC-based Key ...
This math is way over my head, and don't even know if it can be done, but here are the assumptions: 1. Take unencrypted File [Fu] of variable length, but assume 100KB as an example. 2. Let File [Fe] be the AES256 encrypted version of [Fu]. 3. Let Hash [Hu] be the cryptographic hash using MD5 Algorithm of [Fu] 4. ...
Why not use a stream cipher? The requirement for the generating function is not that it is a PRF but a PRG (which in many constructions is build out of a PRF). If you use the key stream of a stream cipher as output then this is a PRG.
I have a Weierstrass elliptic curve ($y^2=x^3+a \times x+b \mod p $) How can I find the order of the group itself? I have seen Mathematica has a `GroupOrder[]` command and WolframAlpha will do it for me, but how can I do it myself, mathematically? The modulus, $p$, will be a large prime number, say 256 bits or mo...
Depends on whether they are "random" files or attacker controlled. MD5 is a 128-bit hash, so for two random files that differ the probability that they have the same MD5 hash is $2^{-128}$. If they are encrypted with strong encryption, their encrypted versions will be random files with again $2^{-128}$ probability o...
<p> Crypto Stack Exchange is for software developers, mathematicians and others interested in cryptography. </p> <p>Cryptography Stack Exchange is for asking questions about the mathematics and properties of cryptographic systems, their analysis ("cryptanalysis") and subsidiary topics that generally make up crypto...
I'm very new to cryptography (and security in general, for that matter), but I had an idea that I'm sure is very flawed, but is worth asking. If a computer user, online account, etc, needs to verify a username and password, wouldn't this work well? 1. Upon signup, ask for username and password as usual 2. Hash user...
I don't get the utility to chain and reduce in generating rainbow tables. Hash functions are made to not have collisions, or at least chain only 2 times so we don't return to the concept of the hash dictionary. So why do we bother the machine to hash and reduce thousand of times to only store the latest value?
Why must we hash lot of times in rainbow tables?
I have some spare time, and a few hundred DJB2-hashed values sitting around. I thought I'd try to do something "useful" and invert DJB2, such that I could calculate the plaintext of the hashes (which has long since been lost, a fact that is often bemoaned). For those who don't know, DJB2 is implemented like this: (C...
I am trying to secure my RF communication in which one RF package consists of two separate segments. I need to make sure that one segment of one packet is not replaced with a valid segment of some previous packet, if you know what I mean. My RF packet is 32 bytes long, and I need to secure it with CMAC (I found an i...
Can I calculate CMAC over two different strings that share 1 common byte?
Should I calculate two CMACs over two different strings that share common bytes?
> Am I on the right track with reversing DJB2 (can it be reversed?)? Is there some way of finding the remainder of a large number that has been modded by 232? You were on a right track to explain why it *can't* be easily inverted. Given an arbitrary $h_i$, every letter of the alphabet will give you another potent...
> What is the probability that both [Hu] = [Hmu] and [He] = [Hme]. In english, what is the chance that two different files can have identical hashes in both an unencrypted and encrypted form? Depends on whether they are "random" files or attacker controlled. MD5 is a 128-bit hash, so for two random files that dif...
The simplest way to generate truly random numbers for OTP keys is to measure the time in milliseconds between each keystroke on a keyboard. The randomness depends on the user typing in various speeds. I coded an algorithm **TRNG-Kms** and did exactly that. *The questions are: How secure is this method for generating...
The simplest way to generate truly random numbers for OTP keys is to measure the time in milliseconds between each keystroke on a keyboard. The randomness depends on the user typing in various speeds. I coded an algorithm **TRNG-Kms** and did exactly that. *The questions are: How secure is this method for generating...
The simplest way to generate truly random numbers for OTP keys is to measure the time in milliseconds between each keystroke on a keyboard. The randomness depends on the user typing in various speeds. I coded an algorithm **TRNG-Kms** and did exactly that. *The questions are: How secure is this method for generating...
The simplest way to generate truly random numbers for OTP keys is to measure the time in milliseconds between each keystroke on a keyboard. The randomness depends on the user typing in various speeds. I coded an algorithm **TRNG-Kms** and did exactly that. *The questions are: How secure is this method for generating...
The simplest way to generate truly random numbers for OTP keys is to measure the time in milliseconds between each keystroke on a keyboard. The randomness depends on the user typing in various speeds. I coded an algorithm **TRNG-Kms** and did exactly that. *The questions are: How secure is this method for generating...
I am trying to secure my RF communication in which one RF package consists of two separate segments. I need to make sure that one segment of one packet is not replaced with a valid segment of some previous packet, if you know what I mean. My RF packet is 32 bytes long, and I need to secure it with CMAC (I found an i...
The simplest way to generate truly random numbers for OTP keys is to measure the time in milliseconds between each keystroke on a keyboard. The randomness depends on the user typing in various speeds. I coded an algorithm **TRNG-Kms** and did exactly that. *The questions are: How secure is this method for generating...
As Stephen already said in his answer, if you use a modern secure encryption scheme, then you do not have to worry about the confidentiality of the messages. However, as you say your application is a chat the following part of your question: > if I add some extra bytes to the message seems to be a valid (altho...
On your earlier questions: > 1) How secure is this method for generating one-time pads in block- or stream-ciphers? This method in itself is not secure, as the output weakly random entropy source, not a TRNG; there is entropy in the keystrokes, but without any whitening and extraction taking place, the output i...
I have been trying this for a while. But I couldn't get it. How can I determine the <br> point of intersection of the tangent line at (0, 0) on the curve $y^2 + y = x^3 + x^2$ ?
I am trying to secure my RF communication in which one RF package consists of two separate segments. I need to make sure that one segment of one packet is not replaced with a valid segment of some previous packet, if you know what I mean. My RF packet is 32 bytes long, and I need to secure it with CMAC (I found an i...
I have been trying this for a while. But I couldn't get it. How can I determine the point of intersection of the tangent line at (0, 0) on the curve $y^2 + y = x^3 + x^2$ ?
Are there any specific [CSPRNG](http://en.wikipedia.org/wiki/CSPRNG)'s that **cannot** be used as [randomness extractor](http://en.wikipedia.org/wiki/Randomness_extractor) within a [TRNG](http://en.wikipedia.org/wiki/TRNG)? In other words, can you simply provide enough entropy gathered from a good entropy source as...
The [Von Neumann](http://en.metapedia.org/wiki/John_von_Neumann) randomness extractor is explicitly mentioned in the [randomness extractor page](http://en.wikipedia.org/wiki/Randomness_extractor) of Wikipedia, but strangely enough that page does not contain any reference to *whitening* the results of an entropy source....
On your earlier questions: > 1) How secure is this method for generating one-time pads in block- or stream-ciphers? This method in itself is not secure, as the output weakly random entropy source, not a TRNG; there is entropy in the keystrokes, but without any whitening and extraction taking place, the output is ...
I found [this paper that explains how to attack a reduced round tiger hash](http://www.iacr.org/archive/asiacrypt2007/48330539/48330539.pdf), but I'm having a hard time understanding some of the mathematical notation. Could someone explain the section "Message Modification by Meet-in-the-Middle" in plain English? Her...
In both cases (the company name and the algorithm name), the letters “RSA” stand for the initials of the surnames of Ron Rivest, Adi Shamir, and Leonard Adleman… $R$ivest, $S$hamir, and $A$dleman. Wrapping it up in short: - In 1977, they (Ron Rivest, Adi Shamir, and Leonard Adleman) first publicly described an al...
I have heard that there is one paradigm of Public key cryptosystem, called **Lattice based crytography**. Further, its security claims are such that it will not be affected even if the quantum computers are available. Would any one be kind enough to help me to understand the basic philosophy behind it, with example...
First of all, I would like to note that I am not building my own crypto. I am simply curious and would like to learn. What I am wondering is this: if we are worried about randomness of something like a one time pad, why don't we run the pad through a compression process (like bzip) to eliminate any patterns? Would...
Compression function to guarantee randomness of one time pads?
How do we add the integer points $P=(-1, 4)$ and $Q=(2, 5)$ on the elliptic curve of the form $y^2=x^3+17$ ?
I have heard that there is one paradigm of Public key cryptosystem, called **Lattice based crytography**. Further, its security claims are such that it will not be affected even if the quantum computers are available. Would any one be kind enough to help me to understand the basic philosophy behind it, with example...
> What happens if the sender is at another point in the sequence? ... > the key is pressed while out of range to the car. In a rolling code (code hopping) system, the keyfob transmitter maintains a synchronization counter C, incremented every time a button is pushed. The car receiver stores the most recent va...
Your parameters that you provide are incomplete (in what group are you working?). Anyways, lets assume that you work in $\mathbb{Z}_p^*$, your have a generator $g$ and your public key is $y=g^x$. Then, if two ciphertexts share the same randomness $k$, they will look like $(c_1,c_2)=(g^k,m\cdot y^k)$ and $(c_1',c_...
Before stating my questions, let us recall the REACT transform [OP01], which enables to construct a CCA-secure hybrid PKE scheme, $\varepsilon'_{pk}$, from an OW-CPA PKE scheme $\varepsilon_{pk}^{asym}$, an IND-secure symmetric encryption scheme $\varepsilon^{sym}$, and hash functions $H$ and $G$. The transform works a...
Before stating my questions, let us recall the REACT transform [OP01], which enables to construct a CCA-secure hybrid PKE scheme, $\varepsilon'_{pk}$, from an OW-CPA PKE scheme $\varepsilon_{pk}^{asym}$, an IND-secure symmetric encryption scheme $\varepsilon^{sym}$, and hash functions $H$ and $G$. The transform works a...
I am trying to create a system where to unlock the application one needs to enter a serial code. I have read many articles on the theme but there are two problems bugging me. One is, If I have a keygen and I can generate as many keys as I like then anyone else can do that too, but solving this by requiring a long "priv...
Consider the function $F$ from $\{0,1\}^{56}$ to $\{0,1\}^{64}$, mapping the operative bits of a DES key to the ciphertext for all-zero plaintext. How could we organize a [rainbow table][1] to invert that function with high probability, low computational cost, and a reasonably-sized table that can be constructed at rea...
> What happens if the sender is at another point in the sequence? ... > the key is pressed while out of range to the car. In a rolling code (code hopping) system, the keyfob transmitter maintains a synchronization counter C, incremented every time a button is pushed. The car receiver stores the most recent vali...
Would it be possible to create an [**Over-The-Top**](http://en.wikipedia.org/wiki/Over-the-top_content) communication utility that will encrypt voice using format preserving encryption (voice clear-text to audio encrypted stream) and send that over an existing channel (eg Skype/ Cellular)?
Before stating my questions, let us recall the REACT transform [OP01], which enables to construct a CCA-secure hybrid PKE scheme, $\varepsilon'_{pk}$, from an OW-CPA PKE scheme $\varepsilon_{pk}^{asym}$, an IND-secure symmetric encryption scheme $\varepsilon^{sym}$, and hash functions $H$ and $G$. The transform works a...
I am very new to cryptography (so be kind), but I have a question that may seem silly. If the one-time pad is the perfect cipher and impossible to crack, why would the following algorithm not be one of the strongest: To encrypt: - generate a random bit array using a pseudo number generator with the key as the...
I am trying to create a system where to unlock the application one needs to enter a serial code. I have read many articles on the theme but there are two problems bugging me. One is, If I have a keygen and I can generate as many keys as I like then anyone else can do that too, but solving this by requiring a long "priv...
Diffie Hellman to agree about nonce - is it secured?
I have a system, using AES, in one of the modes that uses a nonce and authentication. We have a pre-shared key, and to agree about initial nonce we could use Diffie-Hellman, using the resulting secret as an IV. I want to know if there can be any attack on this system: is it possible to perform a man-in-the-middle...
Is it secure to use Diffie-Hellman key agreement to generate a nonce?
I would like to generate a key which would be good enough to be used for encryption with AES in a mobile environment. My idea is to use as a seed ''random attributes'' from a mobile device. Is hashing first this seed using HMAC construction (with some salt which is also random but public) and then use a HMAC-based Key ...
I want to use TLS to encrypt the communication between peers in a P2P network. Each peer has a well known 256bit peer identifier (the public key of a 256bit elliptic curve keypair). Both peers need to be authenticated against the ECC key. Each peer has only one ECC key, no RSA key. During the key exchange step, I d...
I'm attempting to recover plain-text ($P_1, P_2$) from two uneven cipher-text strings ($C_1, C_2$) that I suspect used the same key ($K$). When I XOR $C_1$ and $C_2$ together to obtain ($P_1 + P_2$), there is repetition of a string of characters several times within the XOR string e.g: .81afg.81afg.81afg.81a...
> What is the significance of the repetition? Does it mean that a 6 character key was used and repeated across the same characters within $P_1$ and $P_2$? I'm assuming your assumption about this being an xor cipher with the pad used twice for two ciphertexts. It does not mean a 6 character key was used. A one tim...
First, one point. >Each peer has a well known 256bit peer identifier (the public key of a 256bit elliptic curve keypair). Therefore, _you have PKI_, even though "there is no PKI 'authority'". <br><br><br> >Is this a proper use of ECDH anon, and will a simple challenge/response <br> scheme at the application l...
I have general questions regarding rolling codes. Basically there is a sender and a receiver. Both have a sequence generator. The receiver checks if the received sequence matches the newly generated. An example used is KeeLoq. Assuming a car opener (sender) and a car (receiver): - What happens if the sender is at...
How does a rolling code work?
In order to setup an authenticated shared secret key between two clients, I am faced with the choice between two possibilities: 1. Let users set a (low-entropy) shared password and then perform some password-authenticated key exchange that is resilient to low-entropy secrets (as described [here](http://tools.ietf.or...
> Are there any advantages to “1.”, especially when users must communicate the password/key through a separate channel in both cases? As the comments <sup>([1](http://crypto.stackexchange.com/questions/8923/pak-diffie-hellman-vs-sharing-high-entropy-key#comment16635_8923), [2](http://crypto.stackexchange.com/questi...
> Are there any advantages to “1.”, especially when users must communicate the password/key through a separate channel in both cases? As the comments <sup>([1](http://crypto.stackexchange.com/questions/8923/pak-diffie-hellman-vs-sharing-high-entropy-key#comment16635_8923), [2](http://crypto.stackexchange.com/questi...
> Are there any advantages to “1.”, especially when users must communicate the password/key through a separate channel in both cases? As the comments <sup>([1](http://crypto.stackexchange.com/questions/8923/pak-diffie-hellman-vs-sharing-high-entropy-key#comment16635_8923), [2](http://crypto.stackexchange.com/questi...
Would it be possible to create an [**Over-The-Top**](http://en.wikipedia.org/wiki/Over-the-top_content) communication utility that will encrypt voice using format preserving encryption (voice clear-text to audio encrypted stream) and send that over an existing channel (eg Skype/ Cellular)? Thanks for all the answers...
- My question is a bit naive, but what if someone generate the same RSA key pair as one existing ? This person would have the same private key and so would be able to decrypt messages not intended to him.. I bet that the answer will be : "It is very unlikely".. but I would like a more persuasive answer, to realize ...
Public key Issue - same key pair as existing one?
My question is a bit naive, but what if someone generates the same RSA key pair as someone else? This person would have the same private key and so would be able to decrypt messages not intended to him. I bet that the answer will be: *“It is very unlikely”*, but I would like a more persuasive answer to realize that...
I was wondering how many possible private/public keys exist? If a million people – for whatever reason – would try to generate 5 keys each in the same minute (on the same date and time) is there a high chance of collision? I believe GUID would suffer from that problem as many bits are reversed for date/time (and GUID v...
Would it be possible to create an [**Over-The-Top**](http://en.wikipedia.org/wiki/Over-the-top_content) communication utility that will encrypt voice using format preserving encryption (voice clear-text to audio encrypted stream) and send that over an existing channel (e.g. Skype/ Cellular)? I was wondering if the F...
The answer depends on how you would layer the encryption on top of the existing protocol. 1. If you implemented your own Skype client, you could deal with compression issues yourself. That might allow you to use format preserving encryption, perhaps on the compressed data stream and not the audio itself. Howeve...
"if someone generates the same RSA key pair as someone else", <br> then ... someone will have the same RSA key pair as someone else. <br><br><br> >"when someone generates a key pair, how can he/she <br> be sure that nobody has already generated this key pair?" The _exact_ same ways he/she can generate _any_ un...
The answer to both questions lie in understanding entropy, and how entropy is gathered to create a key. (And, of course, how well the implementation does so without bugs.) Each operating system creates and maintains a pool of entropy from which the entropy, or randomness, is tapped in the process of generating the key....
Finding a decent explanation of rainbow tables was something I struggled with, so firstly I'll cover what they are. I will get to your question in the end. My sources for this are [this guide][1] and the [wikipedia article][2]. **Why can't I just use a big bucket of hashes?** Firstly the naive way to build a reve...
The answer to both questions lie in understanding entropy, and how entropy is gathered to create a key. (And, of course, how well the implementation does so without bugs.) Each operating system creates and maintains a pool of entropy from which the entropy, or randomness, is tapped in the process of generating the key....
The answer to both questions lie in understanding entropy, and how entropy is gathered to create a key. (And, of course, how well the implementation does so without bugs.) Each operating system creates and maintains a pool of entropy from which the entropy, or randomness, is tapped in the process of generating the key....
First, one point. >Each peer has a well known 256bit peer identifier (the public key of a 256bit elliptic curve keypair). Therefore, _you have PKI_, even though "there is no PKI 'authority'". <br><br><br> >Is this a proper use of ECDH anon, and will a simple challenge/response <br> scheme at the application l...
The answer to both questions lie in understanding entropy, and how entropy is gathered to create a key. (And, of course, how well the implementation does so without bugs.) Each operating system creates and maintains a pool of entropy from which the entropy, or randomness, is tapped in the process of generating the key....
<p> Crypto Stack Exchange is for software developers, mathematicians and others interested in cryptography. </p> <p>Cryptography Stack Exchange is for asking questions about the mathematics and properties of cryptographic systems, their analysis ("cryptanalysis") and subsidiary topics that generally make up crypto...
This is from the handbook of applied cryptography (see [1] for chapter link): >Identification based on PK decryption and witness. Consider the following protocol: > > (1) A <- B: h(r), B, P_A(r,B) > > (2) A -> B: r > >(Before (2), A verifies that r' = r and B' = B) My questions are: Why is B needed in t...
This is from the handbook of applied cryptography (see [1] for chapter link): >Identification based on PK decryption and witness. Consider the following protocol: > > (1) A <- B: $h(r), B, P_A(r,B)$ > > (2) A -> B: $r$ > >(Before (2), A verifies that $r' = r$ and $B' = B$) My questions are: Why is B nee...
This is from the handbook of applied cryptography (see [1] for chapter link): >Identification based on PK decryption and witness. Consider the following protocol: > > (1) A <- B: $h(r), B, P_A(r,B)$ > > (2) A -> B: $r$ > >(Before (2), A verifies that $r' = r$ and $B' = B$) My questions are: Why is $B$ n...
> if someone generates the same RSA key pair as someone else, then ... someone will have the same RSA key pair as someone else. > when someone generates a key pair, how can he/she be sure that nobody has already generated this key pair? The _exact_ same ways he/she can generate _any_ unique value. Proof: Le...
The answer to both questions lies in understanding entropy, and how entropy is gathered to create a key. (And, of course, how well the implementation does so without bugs.) Each operating system creates and maintains a pool of entropy from which the entropy – also known as “randomness” – is tapped in the process of gen...
Quoting the handbook of applied cryptography, [**chapter 10.3.3 (i)**](http://cacr.uwaterloo.ca/hac/about/chap10.pdf): > Identification based on PK decryption and witness. Consider the following protocol: > 1. $A \leftarrow B: h(r), B, P_A(r,B)$ > 2. $A \rightarrow B: r$ > (Before “2.”, $A$ verifies that $r...