instruction
stringlengths
15
30k
smart card is a kind of secure device with the limited storage capacity and computational resource, I want to know if we use pseudo-random number generator to generate random number in smart card, then is there any problem?
Are there some problems to use pseudo-random number generator in smart card?
A Smart Card is a kind of secure device with the limited storage capacity and computational resource. If we use a Pseudo-Random Number Generator to generate random numbers in smart card, then is there any problem?
Are there some problems to use pseudo-random number generator in Smart Card?
A Smart Card is a kind of secure device, with limited storage capacity and computational resource. If we use a Pseudo-Random Number Generator to generate random numbers in a Smart Card, then is there any problem?
Is there any tool available that can test whether a simple substitution cipher is working. I will put my scenario in detail. Lets say I built a simple substitution cipher that maps 8 bit data to 16 bit encrypted cipher using an 8 bit key. I need to verify whether the substitution cipher is actually unique for all poss...
I need to know, please: (1) Is there anyway to pick uniformly at random permutation polynomial in a field of prime order? (2) Are there many permutation polynomials in a field? ***Indeed has the permutation polynomial used in this way in cryptography, if yes, where?
I need to know, please: (1) Is there anyway to pick uniformly at random permutation polynomial in a field of prime order? (2) Are there many permutation polynomials in a field? ***Indeed has the permutation polynomial used in this way in cryptography to generate uniformly random value? If yes, where?
Yes! there exist some examples. but whether they are secure or not is another question. In theory, there should not be any problem with the idea since usually in cryptography it is unwittingly assumed that the input data to encryption block is already fully compressed. Examples are [Secure Arithmetic Coding][1], [Se...
I've been exploring Zero Knowledge Proofs and while the [classic cave example][1] by Jean-Jacques Quisquater makes sense, I find the [discrete log example][2] problematic. Since the Verifier is given ***p***, ***g*** and ***y***, where ***p*** is a large prime, ***g*** the generator and ***y* = *g<sup> x</sup>* mod ...
It is often said that RSA encryption with a private key is the same as signing (signature generation). Will RSA encryption with a private key over a cryptographic hash give the same result as performing a signature generation operation?
Is RSA encryption of a cryptographic hash with a private key the same as signature generation?
The [PKCS#1 standard](http://tools.ietf.org/html/rfc3447) defines multiple padding schemes for signature generation/verification ([EMSA-PSS](http://tools.ietf.org/html/rfc3447#section-9.1) and [EMSA-PKCS1-v1_5](http://tools.ietf.org/html/rfc3447#section-9.2)), and encryption/decryption ([EME-OAEP](http://tools.ietf.or...
Which attacks are possible against raw/textbook RSA?
For my crypto assignment, I'm asked to enter a prime P and generate Q such that Q|P-1 Can anyone guide me what is Q|P-1?
What is the value of Q such that Q|P-1 where P is a prime number?
Yes! there exist some examples. but whether they are secure or not is another question. In theory, or at least in my opinion, there should not be any problem with the idea since in some cases in cryptography it is unwittingly assumed that the input data to encryption block is already fully compressed. Examples are [...
*Are there many permutation polynomials in a field?* For a field $F$ of order $q$, every function from $F$ to $F$ is expressable (uniquely) as a polynomial of order $q-1$. $q!$ of these will represent permutation polynomials.
*Are there many permutation polynomials in a field?* For a field $F$ of order $q$, every function from $F$ to $F$ is expressable (uniquely) as a polynomial of order $q-1$. $q!$ of these will represent permutation polynomials. *Is there anyway to pick uniformly at random permutation polynomial in a field of prime...
Yes! there exist some examples. But whether they are secure or not is another question. In my opinion, there should not be any problem with the idea of crypto-compression**. Examples of crypto-compression schemes are [Secure Arithmetic Coding][1], [Secure Huffman Coding][2], [Secure Adaptive Huffman Coding][3], and ...
The [PKCS#1 standard](http://tools.ietf.org/html/rfc3447) defines multiple padding schemes for signature generation/verification ([EMSA-PSS](http://tools.ietf.org/html/rfc3447#section-9.1) and [EMSA-PKCS1-v1_5](http://tools.ietf.org/html/rfc3447#section-9.2)), and encryption/decryption ([EME-OAEP](http://tools.ietf.or...
Why it is more efficient to compute a message digest of message and digitally sign it then, rather than sign the message directly?
Why do we need to compute message digest of a message first while signing it?
In non authenticated DH, p and g are made as public record. p need to be large prime number and g should be smaller than p. why g need to be smaller than p?
why g is less than p in Dieffie Hellman?
In non-authenticated DH, p and g are made as public record. p needs to be a large prime number and g should be smaller than p. Why does g need to be smaller than p?
Why is g is less than p in Diffie-Hellman?
In the first decade of the 21th century, and counting, on a given $\text{year}$, no RSA key bigger than $(\text{year} - 2000) \cdot 32 + 512$ bits has been openly factored other than by [exploitation of a flaw of the key generator][1]. This linear estimate of _academic_ factoring progress should be used neither for lon...
As a beginner in cryptography, I do not know anything about different pairing types more than their names. So far, I know these names: Ate pairing, tate pairing, eta pairing, and r-ate pairing. I am curious whether I should care which type of pairing I am using in my implementations? Do they affect performance or se...
As a cryptographer, what are the things I should care about in my implementation of pairing functions?
I have a prime p = 7 and was tasked to select a random value in Zp* in my signature scheme What does the full range of Zp* contains in this case? Is it {0...7} or {0...6} or {1....6} or {1...7}
What does Zp* contains?
There are some strong studies which [support][1] the use of pronounceable passwords and [multiple][2] [tools][3] which provide generation of such passwords. According to [this question][4] the entropy of a password depends on its method of generation but how can I be sure that my generated pronounceable password has...
![Signature][1] [1]: https://i.stack.imgur.com/Bq1nz.png I can't seem to verify this signature scheme. Taking this as an example: $p = 23$, $g = 7$, Private Key : $(12$, $20$, $3$, $18)$, $y = 16$ and $q = 2$ This will give me: $y_1 = 7$<sup>12</sup>$*16$<sup>20</sup> $= 13 (mod23)$ $y_2 = 7...
![Signature][1] [1]: https://i.stack.imgur.com/Bq1nz.png I can't seem to verify this signature scheme. Taking this as an example: $p = 23$, $g = 7$, Private Key : $(12$, $20$, $3$, $18)$, $y = 16$ and $q = 2$ This will give me: $y_1 = 7$<sup>12</sup>$*16$<sup>20</sup> $= 13 (mod23)$ $y_2 = 7...
> Is it true the longer the key length is the more secure the encryption? No. Key length *does* put an upper bound on security, because it determines the complexity of brute force iteration of the key space or factoring, discrete log, etc. for some asymmetric algorithms. However, once you have a [long enough][1] key...
*(posting as an "answer" because it's a little to long to fit in the "comment" section)* It sounds like you are trying to build a 256 bit block cipher, given a 128 bit cipher and 2 keys for that cipher. > I'm gonna clarify one more time ... The way I intended this to work: > the decryptor uses the second key to ...
> "How can I be sure that my generated pronounceable password has enough > entropy for my use?" One way to guarantee that a passphrase has "enough entropy for my use": Obtain a block of at least that many bits of fresh entropy from /dev/random or some other secure random number generator, and then encode those bit...
Consider the following scenario: > Suppose A and B have set up their RSA public keys, namely $(e_a, n)$ > and $(e_b, n)$, where the n-value is the same. Also, it happens that > the $\gcd (e_a, e_b) = 1$. Suppose C wants to send both A and B a > message $M$ that is coprime with $n$. Thus, C encrypts $M$ using A an...
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've written implementations of Salsa20 and ChaCha that accept 384 and 448 bit keys. It was fairly trivial to implement, the 'sigma' constant is replaced with key material, and the counter, (which was initialized at 0), rotates and can be initialized at any value. So along with the 64 bit vector, the entire 512 bit sta...
Extending key sizes in Salsa20 and ChaCha?
I've written implementations of Salsa20 and ChaCha that accept 384 and 448 bit keys. It was fairly trivial to implement, the 'sigma' constant is replaced with key material, and the counter, (which was initialized at 0), rotates and can be initialized at any value. So along with the 64 bit vector, the entire 512 bit sta...
Given public key encryption scheme (gen; enc; dec), we now construct a new scheme (Gen; Enc; Dec) as follows. The key generation algorithm Gen is the same as gen. Each ciphertext for a message consists of three ciphertexts that independently generated by using the original scheme. That is, Enc(m) = (c1; c2; c3) w...
How can I prove CPA secure by using a new scheme gen,enc,dec from GEN,ENC,DEC?
I've written implementations of Salsa20 and ChaCha that accept 384 and 448 bit keys. It was fairly trivial to implement, the 'sigma' constant is replaced with key material, and the counter, (which was initialized at 0), rotates and can be initialized at any value. So along with the 64 bit vector, the entire 512 bit sta...
I am trying to find out if the SSH protocol preserves integrity of the transferred data in the following scenario: The SSH client is running on a virtual machine, at some point in the middle of the connection a snapshot is made of the virtual machine and another copy of the client is brought up in some location. ...
Does the SSH protocol preserve integrity if an endpoint is cloned?
Given public key encryption scheme $(gen; enc; dec)$, we now construct a new scheme $(Gen; Enc; Dec)$ as follows: * The key generation algorithm $Gen$ is the same as $gen$. * Each ciphertext for a message consists of three ciphertexts that independently generated by using the original scheme. That is, $Enc(m) = (c...
I have a function that derives two sub-keys from one passphrase using PBKDF2 one which is used as a encryption key the other for HMAC generation, because these two sub-keys will need to be regenerated when the user wishes to decrypt there file so the salt used and the number of iterations must be available to the clien...
Storing salts and iteration number?
As a beginner in cryptography, I do not know anything about different pairing types more than their names. So far, I know these names: Ate pairing, tate pairing, eta pairing, and r-ate pairing. I am curious whether I should care which type of pairing I am using in my implementations? Do they affect performance or se...
Are modified implementations of standard cryptographic algorithms better that the standard versions? Since the algorithm is not standard, is it harder to break? Is it safer?
Are modified implementations of cryptographic algorithms a good idea?
Seems to be opinion-based, since there´s a lack of special point (which modification do you want to make?). But similar questions, that asked for specific modifications, get the same answer: in general, by modifying something without knowing specifically what you´re doing, you´ll be making it worst. Crypto algorithm...
I've been thinking of ways to store credit cards securely, I thought of this: - Take the users credit card info - Put the card info in a standard format > "Full Name/Card Num/Security Num/Expiry Date" - Then encrypt the data using a 512 bit private key: > Then I'll have something like this: > > 0c722...
I have a prime $p = 7$ and was tasked to select a random value in $\mathbb Z_p^*$ in my signature scheme. What does the full range of $\mathbb Z_p^*$ contain in this case? Is it $\{0...7\}$ or $\{0...6\}$ or $\{1...6\}$ or $\{1...7\}$?
What does $\mathbb Z_p^*$ contain?
I'm thinking about creating an encrypted messaging web application where users create RSA key pairs, they store the public key on the server for others to see and also store an AES encrypted private key on the server. Thus, to verify their identity, they can decrypt the private key and send a signature. That said, I...
I am looking for the implementation of IPsec security algorithms for both authentication and Encryption. Is there any open source implementation available for the same ? And if someone supposed to implement these algorithms, then what background knowledge is required for someone new in the cryptography world? P...
I am looking for the implementation of IPsec security algorithms for both authentication and Encryption. Is there any open source implementation available for the same ? And if someone supposed to implement these algorithms, then what background knowledge is required for someone new in the cryptography world? P...
Given that you used a strong password to derive the AES encryption key: Yes you could securely store your RSA private key in encrypted form on a server. BUT, since there is no technical need to have your private key on the server, why would you risk it? Look at it that way: Suppose you have very sensible data (like ...
hashing some data and encrypting data share some similar attributes. Surely this is why ["Difference between encrypting something and hashing something"][1] has been asked. The point of this question is hence not repeating the different purposes. Instead I would like to ask. Since hashing does not, by intention p...
Can hashing become encrypting?
A FPE preserves the format. There is a correspondence between the format of the ciphertext and the plaintext. Given that a message in some binary enconded format can easily be divded in some `l` *blocks* of `n` *bits* which will be encrypted to `l` *blocks* of `n` *bits* I would call (some necessary padding issues i...
Are all block ciphers FPE (format preserving encryption)?
hashing some data and encrypting data share some similar attributes. Surely this is why ["Difference between encrypting something and hashing something"][1] has been asked. The point of this question is hence not repeating the different purposes. Instead I would like to ask. Since hashing does not, by intention p...
This is an honest question regarding terminology. I believe that I understand why one mode to use a block cipher is called a codebook. But I wonder why electronic as a work appears here? Is it fair to say this is just a fancy/stylish addition? Should it relfect that often encyption is used with electrical devices?...
What is "electronic" in electronic codebook (ECB)?
According to [this](http://dl.acm.org/citation.cfm?doid=1268776.1268777) primitives like AES and SHA generate proper pseudo random numbers that pass relevant tests. Hence, your scheme should be sufficient for generating a stream of random bytes as encryption key for stream cipher. Although, it should be noted *again...
You can in principle encrypt using a hash function, in the manner you describe (although what you have described is not necessarily a secure construction). What you are trying to do is generate a keystream from a hash function and a key. You can use [counter mode](http://en.wikipedia.org/wiki/Block_cipher_mode_of_o...
A FPE preserves the format. There is a correspondence between the format of the ciphertext and the plaintext. Given that a message in some binary enconded format can easily be divded in some `l` *blocks* of `n` *bits* which will be encrypted to `l` *blocks* of `n` *bits* I would call (some necessary padding issues i...
I am in doubt : of course one can create a tl connection between a client and a server. But what if the client sends self encrypted with, say, blowfish, data to the server? The goal is that the server remains dumb about tls. The question is not if it is possible, it is. But in case of a "unattended listening b...
TLS - self encrypting to avoid tls setup, secure?
In the first decade of the 21th century, and counting, on a given $\text{year}$, no RSA key bigger than $(\text{year} - 2000) \cdot 32 + 512$ bits has been openly factored other than by [exploitation of a flaw of the key generator][1]. This linear estimate of _academic_ factoring progress should be used neither for lon...
In the first decade of the 21th century, and counting, on a given $\text{year}$, no RSA key bigger than $(\text{year} - 2000) \cdot 32 + 512$ bits has been openly factored other than by [exploitation of a flaw of the key generator][1]. This linear estimate of _academic_ factoring progress should be used neither for lon...
Is there an encryption which would produce a ciphertext longer than the plaintext? (please ignore block-chaining IV stuff, which would result in a data being generated from the plaintext). The point in question is that a ciphertext generated $\{0,1\}^n$ seems inferior to one twice as long $\{0,1\}^{2n}$ in terms th...
Encryption in which ciphertext is bigger than plaintext?
Is there an encryption which would produce a ciphertext longer than the plaintext? (please ignore block-chaining IV stuff, which would result in a data being generated from the plaintext). The point in question is that a ciphertext generated $\{0,1\}^n$ seems inferior to one twice as long $\{0,1\}^{2n}$ in terms th...
Can someone help me see the flaw in this cryptosystem? Note: This is homework and it is due today at 1:30pm. An answer before that is not expected; I'd just like to understand what the flaw is. From An Introduction to Mathematical Cryptography By Jeffrey Hoffstein, Jill Pipher and Joseph H. Silverman. problem 3....
Why is this cryptosystem insecure?
I need to know, please: (1) Is there anyway to pick uniformly at random permutation polynomial in a field of prime order? (2) Are there many permutation polynomials in a field? (3) In a finite field of q elements how many bijective polynomials exist whose degree are smaller than d ? ***Indeed has the pe...
Can someone help me see the flaw in this cryptosystem? Note: This is homework and it is due today at 1:30pm. An answer before that is not expected; I'd just like to understand what the flaw is. From _An Introduction to Mathematical Cryptography_ By Jeffrey Hoffstein, Jill Pipher and Joseph H. Silverman (Springer...
Can someone help me see the flaw in this cryptosystem? Note: This is homework and it is due today at 1:30pm. An answer before that is not expected; I'd just like to understand what the flaw is. From _An Introduction to Mathematical Cryptography_ By Jeffrey Hoffstein, Jill Pipher and Joseph H. Silverman (Springer...
I know I am in delay, but just to give my opinion: AES may be secure, even RSA may be secure but unlike the one time pad they do not have a mathematical proof of being secure. And the fact that NSA recommends to use AES give me some doubts… - Do they recommend this because they know how to break it? - Why did th...
Consider a common practically-collision-resistant hash function $\mathcal{H}$ (e.g. [SHA-1][2], [SHA-256][4], [SHA-512][5], [RIPEMD-160][3]), perhaps based on the [Merkle–Damgård construction][1] as are the first three. We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathca...
Can someone help me see the flaw in this cryptosystem? Note: This is homework and it is due today at 1:30pm. An answer before that is not expected; I'd just like to understand what the flaw is. From _An Introduction to Mathematical Cryptography_ By Jeffrey Hoffstein, Jill Pipher and Joseph H. Silverman (Springer...
In the first decade of the 21th century, and counting, on a given $\text{year}$, no RSA key bigger than $(\text{year} - 2000) \cdot 32 + 512$ bits has been openly factored other than by [exploitation of a flaw of the key generator][1]. This linear estimate of _academic_ factoring progress should be used neither for lon...
Let's imagine a cipher that works like the following: 1. Plaintext is encoded to Base64. 2. The characters in the encoded plaintext are substituted with a randomly shuffled character set(A-z, 0-9, -, _, =). The shuffled alphabet is, in essence, the key. Not particularly complex or even secure. But... What i...
How can cryptext where the plaintext is Base64 encoded be frequency-analyzed?
Let's imagine a cipher that works like the following: 1. Plaintext is encoded to Base64. 2. The characters in the encoded plaintext are substituted with a randomly shuffled character set(A-z, 0-9, -, _, =). The shuffled alphabet is, in essence, the key. Not particularly complex or even secure. But... What i...
I know I am in delay, but just to give my opinion: AES and RSA are not secure, because they simply do not have a mathematical proof of being secure. In everyday practice thy show to be unbreakable because no one has still found a method to break them, but maybe someone knows it and keeps secret( prima facotor solvin...
Let's imagine a cipher that works like the following: 1. Plaintext is encoded to Base64. 2. The characters in the encoded plaintext are substituted with a randomly shuffled character set(A-z, 0-9, -, _, =). The shuffled alphabet is, in essence, the key. Not particularly complex or even secure. But... What i...
Let's imagine a cipher that works like the following: 1. Plaintext is encoded to Base64. 2. The characters in the encoded plaintext are substituted with a randomly shuffled character set(A-z, 0-9, -, _, =). The shuffled alphabet is, in essence, the key. Not particularly complex or even secure. But... What i...
Aremed with only basic crypto knowledge, I'm trying to understand the security benefits of LUKS over plain-mode dm-crypt. Hopefully this is a good place to ask. Given the LUKS header contains information describing how the payload is encrypted, would it not be more secure to use plain dm-crypt instead? I'm thinki...
what are the security benefits of LUKS?
Disclaimer: This is a copy of [my stackoverflow question](http://stackoverflow.com/questions/26871259/can-rsa-signing-be-implemented-on-top-of-rsa-encryption-decryption) for improving my odds at getting an answer. :) I need to use RSA-SHA256 signing. Unfortunately not all Microsoft CryptoAPI providers support that. ...
Can RSA signing be implemented on top of RSA encryption/decryption?
In various cryptographic programs I've written (most have been toy problems, but this current one is not) I have taken a slothful approach to performing a message digest (hash) of numerical input. I have been casting the numbers to strings, concatenating them, and then performing the hash. (Actually, this is a keyed ha...
ASCII input to HMAC weaker than raw bytes?