instruction
stringlengths
15
30k
After reading [this][1] paper entitled *Key Recovery Attacks of Practical Complexity on AES Variants With Up To 10 Rounds* I was left wondering why the key schedule of AES is invertable. In the paper the authors use a related-key-attack to recover the round keys, bit by bit, making some guesses, but they are eventua...
Is the AES Key Schedule weak?
Homomorphic encryption is often touted for its ability to 1. Compute on encrypted data with public functions 2. Compute an encrypted function on public (or private) data I feel I have a good grasp of #1 as most of the papers I've come across on homomorphic encryption (both partially and fully) seem to deal wit...
How to construct encrypted functions (with either public or private data)?
I got this question in my WebAssign: The number 43733 was chosen as base for an implementation of the RSA system. M=19985 this is the message, that was encrypt with help of a public key K=53. What is the plaintext text is? What is the private key is? My Calculations: n=pq n=101*433 ϕ(43...
The number $43733$ was chosen as base for an implementation of the RSA system. $M=19985$ is the message, that was encrypted with help of a public key $K=53$. What is the plaintext text? What is the private key? So far, my calculations are: 1. $n=pq$ 2. $n=101*433$ 3. $\phi(43733) = (101 − 1)*(433 − 1) =...
In few implementations of hashed passwords, I have seen that length of random salt is chosen to be 10 or say "some constant". Is there any specific reason why salt is chosen to be of same length. Can a smart attacker Trudy take advantage of it. Does hashed password with random salt make the password stronger? Tha...
without doing your homework for you: did you check the open-source implementations of ISO 8583? is the answer somewhere in there? - [DL-ISO-8583, in C](http://www.oscarsanderson.com/iso-8583/) - [jPOS ISO-8583 Framework, in Java](http://jpos.org/) - [j8583, also Java](http://j8583.sourceforge.net/) - [PHP ISO...
As I understand, PUFs work by using two procedures: generation and reproduction. Generation reads a value $w$ from a fuzzy source and generates a key $R$ and helper data $P$. Then, in the reproduction procedure, it reads $w'$ from the fuzzy source and, using $P$, is able to recover $R$. My question is: this seems to...
The [ASN.1 spec][1] for the [PKCS1][2] RSA private key format is as follows: RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, -- n publicExponent INTEGER, -- e privateExponent INTEGER, -- d prime1 INTEGER, -- p ...
A lot depends on your threat model, your system setup, etc. Do you require mutual authentication? Are connections secured with SSL or a similar protocol? For passwords [scrypt][1] or [bcrypt][2] would be the way to go. They are better than just a simple salt + password setup. [It has been recommended][3] by someone ...
There is 26-letter English alphabet. There is the plain text: TRYAGAINLATER. I need to encrypt it by RSA algorithm with the public key 53. What is the ciphertext? Therefore: M=TRYAGAINLATER M=19 17 24 0 6 0 8 13 11 0 19 4 17 Encryption: c = m^e(mod n) = m^53(mod 26) The problem is that m^53 is huge numbe...
There is 26-letter English alphabet. There is the plain text: `TRYAGAINLATER`. I need to encrypt it by RSA algorithm with the public key 53. What is the ciphertext? Therefore: `M = TRYAGAINLATER`, `M=19 17 24 0 6 0 8 13 11 0 19 4 17`. Encryption: $c = m^e \pmod n = m^{53} \pmod{26}$ The problem is that...
The [ASN.1 spec][1] for the [PKCS1][2] RSA private key format is as follows: RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, -- n publicExponent INTEGER, -- e privateExponent INTEGER, -- d prime1 INTEGER, -- p ...
Why does the PKCS1 RSA private key structure contain more than just exponent and modulus?
Very related to [this question][1] but not addressed there. Does the following construction risk introducing any vulnerabilities that render it less secure than using either of its individual components in isolation?: `EncryptAB(K1||K2, PT) = EncryptA(K1, EncryptB(K2, PT))` `EncryptA` and `EncryptB` may be ...
Can nesting different ciphers with different keys every decrease security?
As Paŭlo and Poncho cover, you don't avoid large numbers. In real life cryptographic implementations (where RSA is concerned) you need a bignum library or bignum implementation even to store numbers of the magnitude required; as you've no doubt noticed, *practically handling* large numbers with what a programming la...
I'm using a [random number generator][1] that requires me to pass it a big (several kilobytes) pool of random data for initialization. I've gathered entropy from various system metrics (free memory, system clock, mac address .etc) and generated a 64-bit seed value which I need to "stretch" over the big memory pool. ...
I'm using a [random number generator][1] that requires me to pass it a big (several kilobytes) pool of random data for initialization. I've gathered entropy from various system metrics (free memory, system clock, mac address .etc) and generated a 64-bit seed value which I need to "stretch" over the big memory pool. ...
What you ask for is a RNG to produce some output which another RNG will use as seed. This looks quite overly complex... The point of the seed is to be unknown to the attacker: the seed data should be such that "trying out" possible seed values should not match the actual seed except with negligible probability. With...
Reformulation of the question: Alice is given $n$ ciphers ( $cipher_0,cipher_1,...cipher_n$) to build a key expander, one of these ciphers is a secure cipher (random permutation) and the rest ($n-1$ of them) can be maliciously controlled by Eve. Alice are unable to inspect these ciphers or their input/outputs to determ...
How can I repeatedly prove I have data another has seen without sending the data and without the other storing the data?
What you are describing is a particular type of "[Provable Data Possession][1]." There have been a number of papers in this area recently (try [googling it][2]). A closely related concept is "Proof of Retrievability." If I recall correctly, the protocols in the paper cited above have all the properties you are inter...
What you are describing is a particular type of "[Provable Data Possession][1]." There have been a number of papers in this area recently (try [googling it][2]). A closely related concept is "Proof of Retrievability." If I recall correctly, the protocols in the paper [I cited above][3] have all the properties you ar...
I will just add few comments to the excellent answer and links provided by PulpSpy above which might help you getting the more correct paper from the pool of thousands of paper written in this area, both by theoreticians and practitioners. If you want to have a proof that prove the possession of any bit of the data ...
Is it possible to encrypt data in a way that it can be proven that the data is encrypted, without revealing the key? 1. Alice chooses some plaintext, then she encrypts it with a certain scheme. She also creates a proof that she the cypher text was produced with that encryption scheme. 2. When she hands that proof+c...
There are a number of zero-knowledge proofs for proving knowledge of a plaintext. These work with public key cryptosystems but not block ciphers. For example, with Elgamal: $\langle g^r, m\cdot y^r \rangle$ it is sufficient to prove knowledge of $r$ in $g^r$. This can be done with a [Schnorr proof][1] (and made non-int...
I was thinking about sending some sensitive data (temperature) from an arduino (AVR 8-bit processor) to a server on the internet. But I would like to make sure that it would not be possible for Eve to find the temperature. I understand that the only way to solve this is to share a secret between the arduino and t...
What is the best way to send two floating point numbers to a server on the internet from a small device such as an arduino?
You have to define precisely what Eve can and cannot do. For instance, has Eve occasional physical access to the Arduino-based device ? If yes, then she can (at least conceptually) grab the device, "open" it, extract the shared secret, and replace the device with one of here own which does the same job, except that it ...
You have to define precisely what Eve can and cannot do. For instance, has Eve occasional physical access to the Arduino-based device ? If yes, then she can (at least conceptually) grab the device, "open" it, extract the shared secret, and replace the device with one of here own which does the same job, except that it ...
Here's my two cents. Since you've already said that a trusted third party is giving them the hashes, here's what to do - team A has file fA and hash of file fB denoted as h(fB) and team B has file fB and hash h(fA). Both teams also get hashes of their own files, so team A has h(fA) and team B has h(fB) as well. Th...
I am wondering to what degree we can define an RSA variant, with a security argument that it is as safe as regular RSA with a given modulus size $m$ (e.g. $m=2048$), in which the **public** key has a compact representation of $k \ll m$ bits. We can fix the public exponent to our favorite customary value, e.g. $e=2^{...
Can nesting different ciphers with different keys ever decrease security?
I've been trying to learn cryptanalysis. I've come across this resource which proved very helpful: http://theamazingking.com/crypto-feal.php So far I've been almost successful in breaking FEAL4 using differential cryptanalysis - I've got three of four rounds down and working on the last one. Basically the method ...
Differential cryptanalysis - breaking the last round of FEAL4?
So I was trying to understand the basic difference between erasure coding and secret sharing, and I found this paper (that you can find [here][1] or [here][2]). For what I understand, it states that Shamir's Secret Sharing is basically a particular instance of a Reed-Solomon Code; However I cannot really understand...
First of all, the choice of word "Erasure code" is not appropriate. RS code can be used as an erasure code, but when you are talking about erasure code, you implicitly work in the area where some bits of the data has been deleted (note the difference from ECC where you know that the data has been corrupted). An erasure...
First of all, the choice of word "Erasure code" is not appropriate. RS code can be used as an erasure code, but when you are talking about erasure code, you implicitly work in the area where some bits of the data has been deleted (note the difference from ECC where you know that the data has been corrupted). An erasure...
Very related to [this question][1] but not addressed there. Does the following construction risk introducing any vulnerabilities that render it less secure than using either of its individual components in isolation?: `EncryptAB(K1||K2, PT) = EncryptA(K1, EncryptB(K2, PT))` `EncryptA` and `EncryptB` may be ...
Verifiable to whom? Someone else with the correct answer? Then you may be able to get away with a salted bcrypt hash; e.g., you can easily say make a cryptographically strong one-way hash of an answer: >>> import bcrypt #using py-bcrypt python module >>> hashed_answer = bcrypt.hashpw('[secret answer to pr...
Is there a practical method, and if so what is the method, to reveal that I have the following type of answer but conceal the answer itself? The answer is, let's say, the solution to a Project Euler problem. That is all. However, I'm new here. I'll try to explain why I hope this question will be considered appropria...
Can I construct a zero-knowledge proof that I solved a Project Euler problem?
Verifiable to whom? Someone else with the correct answer? Then you may be able to get away with a salted bcrypt hash; e.g., you can easily say make a cryptographically strong one-way hash of an answer: >>> import bcrypt #using py-bcrypt python module >>> hashed_answer = bcrypt.hashpw('[secret answer to pr...
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she knows a message $m$ such that $H(m)=h$. Can she convince Bob of this claim without help of a thi...
Prooving knowledge of a preimage of a hash without disclosing it?
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she knows a message $m$ such that $H(m)=h$. Can she convince Bob of this claim without help of a thi...
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she (or/and her friends and devices they have access to) knows a message $m$ such that $H(m)=h$. Can...
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she (or/and parties she can communicate with or/and devices they have access to) knows a message $m$...
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she (or/and parties she can communicate with or/and devices they have access to) knows a message $m$...
I am new to PHP programming and trying to grasp the idea of hashing and encryption for protecting passwords, credit card details and such. I've done a lot of reading about MD5 which I think I understand the basics of now. I've seen places recommending that I use SHA2, which I don't understand how to implement. Back...
Salts, how does the script know what the salt is?
> Do I have to store the salt used on the specified password in the > database so it knows what to use next time? Yes that is exactly correct. Salts are not secret values but they do need to be randomly selected (without bias). This is why dates are bad: they are low entropy. Dynamic salt doesn't mean the s...
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she (or/and parties she can communicate with or/and devices they have access to) knows a message $m$...
I want to know the meaning and usage of salt in cryptography. I am totally unaware about this term salt, and what is the role of salt in cryptography ?
I'm a beginner to cryptography and looking to understand in very simple terms what salt is, when I might need to use it and why I should/should not use it. Can anyone offer me a very simple and clear explanation please? If you know of any references I might read on the topic, these would also be useful in addition t...
> Do I have to store the salt used on the specified password in the > database so it knows what to use next time? Yes that is exactly correct. Salts are not secret values but they do need to be <s>randomly selected (without bias)</s> distinct. This is why using dates may require some care: they have low entropy...
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she (or/and parties she can communicate with or/and devices they have access to) knows a message $m$...
We consider a public hash function $H$, assumed collision-resistant and preimage-resistant (for both first and second preimage), similar in construction to SHA-1 or SHA-256. Alice discloses a value $h$, claiming that she (or/and parties she can communicate with or/and devices they have access to) knows a message $m$...
Mainly I'm trying to understand how to correctly create the Key and IV for use with the .NET Implementation of AES (AesManaged class). This encryption code will be used in conjunction with existing customer records in a database. Here is the process that I've come up with. First, get the key from an encrypted we...
How do I correctly derive a Key and IV?
Cryptographically speaking, `AesManaged` uses AES in CBC mode. To ensure this operates securely, you need to choose the IV randomly, i.e. it should not be possible to predict the IV between iterations. This question has a discussion of non-random IVs: [ Using a Non-Random IV with modes other than CBC](http://crypto.sta...
Cryptographically speaking, `AesManaged` uses AES in CBC mode. To ensure this operates securely, you need to choose the IV randomly, i.e. it should not be possible to predict the IV between iterations. This question has a discussion of non-random IVs: [ Using a Non-Random IV with modes other than CBC](http://crypto.sta...
I am quite curious as to how you can perform simple encryption for the Chinese language. Saw a similar question related to encryption/Chinese here: [About cryptography in a character language](http://crypto.stackexchange.com/questions/261/about-cryptography-in-a-character-language), however the method of encryption...
How would you go about generating a list of unique (distinct) random numbers - where the numbers contain alphanumeric digits and are of a fixed length?
How to generate a list of unique random numbers?
I take your question to mean, how both historically and in the modern age one could construct a pen-and-paper cipher using the Chinese language. As pointed out in the question, Chinese is a [logographic langauge][1] and therefore has a far greater number of characters than Phonetic systems. Historically this has cau...
Is there a practical method, and if so what is the method, to reveal that I have the following type of answer but conceal the answer itself? The answer is, let's say, the solution to a Project Euler problem. That is all. However, I'm new here. I'll try to explain why I hope this question will be considered appropria...
It seems I can't comment on answers because the question is no longer on the Chinese Q&A, but I wanted to support fgrieu's suggestion. Certain web services don't have much care for security, but they want to avoid containing keywords that are blocked by the Chinese Firewall. One I'm familiar with is PIMCloud, a cloud-...
While calculating RSA encryption key we take modulo(phi(n)) rather that modulo(n). I couldn't understand why its so?
Firstly, a number theory textbook might well help here. I own [An Introduction to the theory of numbers](http://www.amazon.co.uk/Introduction-Theory-Numbers-G-Hardy/dp/0199219869/ref=sr_1_1?ie=UTF8&qid=1328113687&sr=8-1) which will give you a grounding in this and many other number theory topics which crop up in crypto...
Firstly, a number theory textbook might well help here. I own [An Introduction to the theory of numbers](http://www.amazon.co.uk/Introduction-Theory-Numbers-G-Hardy/dp/0199219869/ref=sr_1_1?ie=UTF8&qid=1328113687&sr=8-1) which will give you a grounding in this and many other number theory topics which crop up in crypto...
Consider the following protocol: Bob has a private RSA key $B_{priv}$, and Alice knows the public key $B_{pub}$. Alice wants to send confidential messages to Bob (no integrity intended). To send a message, Alice randomly generates a single-use symmetric key (say, an AES key) $K$, encrypts the message with this symmetri...
Is RSA of a random nonce with no padding safe?
I know that `md5` shouldn't be used for password hashing because of collisions and possibility of making dictionary attacks e.g. using rainbow tables. But what about other uses? Can I use `md5` for encrypting data? Say, attacker gains access to database where sensitive data was stored using md5. He wants to know jus...
Can md5 be used for encrypting data?
I having trouble verifying an ECDSA signature signed using client side javascript with Java/BouncyCastle. The javascript signing function [source][1] sign: function (hash, priv) { var d = priv; var n = ecparams.getN(); var e = BigInteger.fromByteArrayUnsigned(hash); do { var k = ECDSA.getB...
If you pad a 128-bit value $K$ with zeroes to the left, and interpret the value numerically with big-endian convention (as happens in PKCS#1 in general), you end up with a value which is no greater than $2^{128}$. If the public exponent is $e = 3$, then the "encrypted value" is no greater than $2^{768}$, and no actual ...
I'm trying to understand the precise requirements on padding when using RSA for encryption. Suppose Alice uses RSA to encrypt a payload $M$ that cannot be guessed (say, a random nonce): Alice send $\mathrm{RSA}_{B_{pub}}(\mathrm{pad}(\mathtt{?}) || M)$ to Bob, with a padding procedure to be determined. Assume reason...
Does RSA padding have to be unpredictable if the payload is?
What type of hash functions provides non-malleability of hash digests?
Verifiable to whom? Someone else with the correct answer? Then you may be able to get away with a salted bcrypt hash; e.g., you can easily say make a cryptographically strong one-way hash of an answer: >>> import bcrypt #using py-bcrypt python module >>> hashed_answer = bcrypt.hashpw('[secret answer to pr...
Verifiable to whom? Someone else with the correct answer? Then you may be able to get away with a salted bcrypt hash; e.g., you can easily say make a cryptographically strong one-way hash of an answer: >>> import bcrypt #using py-bcrypt python module >>> hashed_answer = bcrypt.hashpw('[secret answer to pr...
I am attempting to determine the strength of an incorrectly implemented 1024 bit RSA signature scheme. The weakness in the implementation is that the padding data lacks random numbers. As a result, for every message signed, only 160 bits of data are changed (cryptographic hash). How does one determine the resulting ...
It is possible to implement AES on 4-bit microcontroller? As far as I know, AES on 8-bit microcontroller are common especially for light weight application such as the RFID. I have yet to come across AES been employed on 4-bit microcontroller, therefore I have been wondering whether such implementation is feasible.
Yes, AES can be implemented on a 4-bit micro-controller such as this [EM6626][1], and that's not rocket science or stupidly slow. This [application note][2] illustrates that all kind of 8-bit operations are simple, and table lookups are possible. In fact, tables are not even indispensable if performance is non-criti...
Yes, AES could be implemented on a 4-bit micro-controller such as this [EM6626][1], and that would not be rocket science or stupidly slow. This [application note][2] illustrates that all kind of 8-bit operations are simple, and table lookups are possible. In fact, tables are not even indispensable if performance is ...
I'm writing an RSA algorithm, and am wondering what is the best and/or usual way to choose the initial prime numbers (p and q). I know of two methods to achieve this, one based on a prime number sieve and another based on primality tests: 1) Use a prime sieve to find prime numbers within a random range, and then ...
It seems to be common practice (at least in some communities) to tack on the phrase "with current computing power" when estimating the absurdly long time it would take to, for example, brute-force an ECDSA private key or find an SHA256 collision, but am I wrong in thinking that these calculations should account for the...
How to account for moore's law in estimating time-to-crack?
You put an input and the hash value comes as an output then when someone puts the input the hash function it is applied to see if it is the same hash original value is stored in some database , that is how it works if I remember it corretly. However I am having some trouble understanding timestamps now, I have just ...
How are timestamps verified?
You put an input and the hash value comes as an output then when someone puts the input the hash function it is applied to see if it is the same hash original value is stored in some database , that is how it works if I remember it correctly. However I am having some trouble understanding timestamps now, I have ju...
I'm writing an RSA algorithm, and am wondering what is the best and/or usual way to choose the initial prime numbers (p and q). I know of two methods to achieve this, one based on a prime number sieve and another based on primality tests: 1. Use a prime sieve to find prime numbers within a random range, and then ...
How to better generate large primes: sieving and then random picking or random picking and then checking?
Suppose there are 3 persons, Alice, Bob and Peter. They are identified by their pseudonyms (public RSA keys). Alice has a key `Alice`, Bob has `Bob-Work` and `Bob-Friends`. Peter has `Peter`. `Peter` knows `Alice`. `Alice` expresses trust to `Bob-Work`. Peter knows `Bob-Friends`. **The question is**, How...
In protocols SSL, bot symmetric and asymmetric algorithms are used. Why is it so? symmetric more secure/easy than other. Why asymmetric more preferred in key exchange?
In SSL protocols, both symmetric and asymmetric algorithms are used. Why is it so? The symmetric algorithms are more secure and easier to implement. Why are asymmetric algorithms usually preferred in key exchange?
Say you encrypt a message with a key 'k'. o With *symmetric* encryption (ie. symmetric ciphers), 'k' must be secret. The sender and recipient must agree (somehow) on 'k'. No-one else can be allowed to find out 'k'. Anyone else who finds out 'k', can decrypt all the messages encrypted with 'k'. For that reason, sy...