instruction
stringlengths
15
30k
I need to use RSA-SHA256 signing. Unfortunately not all Microsoft CryptoAPI providers support that. It's possible that I might get a handle to a CryptoAPI provider that can just encrypt/decrypt with RSA, and maybe sign with SHA1, but not SHA256. Also, the private key might be unavailable (say, it could be in a smart ca...
Sorry for this ignorant question but I am currently weighing up the advantages and disadvantages of BCrypt over PBKDF2 and from what I have read BCrypt is considered more secure but from what I have discovered BCrypt only derives as 248-bit key (Example: E2cP18g8DyWwg3emgpHOaPBZzrcRVrO) and the rest of it is the salt, ...
Using bcrypt derived keys for encryption?
AES and RSA (based on prime factory) are not information-theoretically (unconditional) secure, because they simply do not have a mathematical proof of being secure. Still today there is not a proof that proves that prime factor is defininively a difficult or simple problem (P=NP? one of the biggest mistery of math). ...
Let $E$ be a random [even permutation][1] of the set $\{0\dots n-1\}$. We construct a permutation $P$ of the set $\{0\dots m-1\}$, for some $m\le n$, using _cycle-walking_; that is, computing $P(x)$ is as follows: - repeat - $x\gets E(x)$ - until $x<m$ - output $x$ What are odds that $P$ is an even permutat...
Your question is kind of broad, but I think it's still more or less answerable. Let me just address your sub-questions one by one: > 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? Yes, plenty...
Let $E$ be a random [even permutation][1] of the set $\{0\dots n-1\}$. We construct a permutation $P$ of the set $\{0\dots m-1\}$, for some $m\le n$, using _cycle-walking_; that is, computing $P(x)$ is as follows: - repeat - $x\gets E(x)$ - until $x<m$ - output $x$ What are odds that $P$ is an even permutat...
In NIST SP800-38A: Recommendation for Block Cipher Modes of Operation CFB can be used with a parameter `s` - the size of a data segment in bits - which determines the amount of key stream material that is produced per block. API's often also have parameters to at least generate a segment 8 of bits or a segment of ...
In NIST SP800-38A: Recommendation for Block Cipher Modes of Operation CFB can be used with a parameter `s` - the size of a data segment in bits - which determines the amount of key stream material that is produced per block. API's often also have parameters to at least generate a segment 8 of bits or a segment of ...
SSLv3 is almost 18 years old,why it has not been updated to more advance version with stronger rules and structure. What have been the issues and dependencies in doing so till now???
why SSL v3 has not yet been upgraded to a higher version with stronger principles,what are the dependencies and issues to do so?
SSLv3 is almost 18 years old; why has it not been updated to a more advanced version with stronger rules and structure. What have been the issues and dependencies in doing so till now???
Why has SSL v3 not yet been upgraded to a higher version with stronger principles, what are the dependencies and issues to do so?
Let $E$ be a random [even permutation][1] of the set $\{0\dots n-1\}$. We construct a permutation $P$ of the set $\{0\dots m-1\}$, for some $m\le n$, using _cycle-walking_; that is, computing $P(x)$ is as follows: - repeat - $x\gets E(x)$ - until $x<m$ - output $x$ What are odds that $P$ is an even permutat...
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...
> BCrypt is considered more secure The theoretical security of bcrypt has received less scrutiny than that of PBKDF2, SHA2 and HMAC. PBKDF2 is thus widely standardised (e.g. in [NIST SP800-132](http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf) and [PKCS #5](https://tools.ietf.org/html/rfc2898))...
I thought encryption algorithms(like AES) are used to encrypt texts,so how a file or folder(containing pictures,videos,...) is encrypted?What is encrypted exactly?
How a file is encrypted?
First of all, I only understand the **P** versus **NP** debate on a rather shallow level as I am not a computer scientist. So perhaps the answer to the question is straightforward but if not, I would be interested to know more. I believe the consensus amongst computer scientists, complexity theorists, and programme...
Are post-quantum cryptographic ciphers *also* secure if the P=NP conjecture holds true?
Let $E$ be a random [even permutation][1] of the set $\{0\dots n-1\}$. We construct a permutation $P$ of the set $\{0\dots m-1\}$, for some $m\le n$, using _cycle-walking_; that is, computing $P(x)$ is as follows: - repeat - $x\gets E(x)$ - until $x<m$ - output $x$ What are odds that $P$ is an even permutat...
> *Do the post-quantum ciphers also automag/tically address the 1st problem?* Not really, however to explore that in any detail, we need to explore what the 1st problem is. If $P=NP$ is proven true, what does that practically mean? Well, it might have absolutely no practical ramifications, or it might mean that ...
> *Do the post-quantum ciphers also automag/tically address the 1st problem?* Not really, however to explore that in any detail, we need to explore what the 1st problem is. If $P=NP$ is proven true, what does that practically mean? Well, it might have absolutely no practical ramifications, or it might mean that ...
Let $E$ be a random [even permutation][1] of the set $\{0\dots n-1\}$. We construct a permutation $P$ of the set $\{0\dots m-1\}$, for some $m\le n$, using _cycle-walking_; that is, computing $P(x)$ is as follows: - repeat - $x\gets E(x)$ - until $x<m$ - output $x$ What is the probability that the parity of...
Why is there a need to generate more than one high entropy seed? It would seem like if the original source of entropy is high quality, than some 512 bits should be more than enough to seed a CSPRNG which has no strong (or known) weaknesses, and pretty much endlessly generate new random numbers and re-seed itself. The a...
CSPRNG's (ELI5) What's the purpose of multiple seeds/ regenerating sources of entropy (i.e. /dev/random)?
I'm currently dealing with multiple blowfish-encrypted files that share the same key. All are encrypted using ECB mode judging from [their appearance][1]. I don't know what the key is but I know 64 byte (or 6 blocks) of consecutive plaintext. The key length used is most certainly 448 bit. Now, I just recently starte...
Blowfish ECB mode: Tools for known-plaintext attack?
My family was planning a [secret santa](http://en.wikipedia.org/wiki/Secret_Santa) and I thought about how I might write a little web app to dole out these secret assignments. But the downsides to this approach are obvious: there's no way for the users to know that I'm a) generating the results randomly and b) not snoo...
Suppose that the key generation is insecure; each key bit is independently generated, but the value of each key bit is '$1$' with probability $0.90$. These keys are used in AES. What is an efficient attack against these weak keys. The only thing I know is that a randomly chosen key has a lot of $1$s. But from this ...
I'm working with a payment provider which uses the following algorithm for signing messages: 1. The merchant is securely given a secret key `k`, known to them and the payment provider only. 2. The payment is implemented by using a redirect, and the merchant later receives callbacks containing information about the ...
I'm working with a payment provider which uses the following algorithm for signing messages: 1. The merchant is securely given a secret key `k`, known to them and the payment provider only. **EDIT:** Usually the key is quite long. 2. The payment is implemented by using a redirect, and the merchant later receives ...
Suppose the vector boolean function be $$\begin{align} f:F^n_2 \longrightarrow F_2^n \\ (x_1,\dots ,x_n) \longrightarrow (x_2,\dots x_n,g) \\ \\ g:F^n_2 \longrightarrow F_2 \\ (x_1,\dots ,x_n) \longrightarrow \{0,1\} \end{align}$$ What should be the condition on the Boolean function $g$ so that $f$ becomes...
As defined by Shannon, a cipher is perfectly secure if ciphertext leaks no information about the plain text. Under this definition, can ciphertext leak something about the key? Are there any ciphers for which this is true? Thank you for your time!
Perfectly secret cipher can leak about the key?
As defined by Shannon, a cipher is perfectly secure if ciphertext leaks no information about the plain text. Under this definition, can ciphertext leak something about the key? Are there any ciphers for which this is true?
In general (without talking about MD5): Suppose our hashfunction $H$ is a [Merkle-Damgard construction](http://en.wikipedia.org/wiki/Merkle%E2%80%93Damg%C3%A5rd_construction) using a [Davies-Meyer](http://en.wikipedia.org/wiki/One-way_compression_function#Davies.E2.80.93Meyer) compression function $h=(H_i,m)=E_{m_i}(...
In NIST SP800-38A: Recommendation for Block Cipher Modes of Operation CFB can be used with a parameter `s` - the size of a data segment in bits - which determines the amount of key stream material that is produced per block. API's often also have parameters to at least generate a segment 8 of bits or a segment of ...
[mikeazo][1]'s answer clearly covers what the question asks. However, I want to go further and answer this: **How much information does a perfectly secure cipher leak about the key?** **Exactly all the excessive information of the key that does not help in finding anything about the message.** **In simple word...
Suppose AES-$128$. There are $4$ operations in AES's encryption, they are SubByte, Shift Row, MixColumns and AddRoundKey. Question: If I remove one of the following opearations, what will happen to the AES? SubByte, Shift Row, MixColumns If Shift Row is removed, then attacker can treat input block ($128$ bits...
The "How" is already explained well by others, but as far I can see, nobody wrote about "*What* does asymmetric encryption do?". It does **not**, as many think, magically allow two parties Alice and Bob to communicate *securely* over a public channel. Instead, it converts an *authentic* channel from Alice to Bob ...
The "How" is already explained well by others, but as far I can see, nobody wrote about "*What* does asymmetric encryption do?". It does **not**, as many think, magically allow two parties Alice and Bob to communicate *securely* over a public channel. Instead, it converts an *authentic* channel from Alice to Bob ...
The "How" is already explained well by others, but as far I can see, nobody wrote about "*What* does asymmetric encryption do?". It does **not**, as many think, magically allow two parties Alice and Bob to communicate *securely* over a public channel. Instead, it converts an *authentic* channel from Alice to Bob ...
I read the following paragraph in a book about Elliptic Curve Cryptography, but didnt understand: The primary security in ECC is the parameter n; where n is Order of point G , that is n is the smallest positive integer such that nG = O.where G is A base point represented by $G= (xg, yg)\ on\ E (F_P)$ What is mean ...
What is primary security in ECC?
I read the following paragraph in a book about Elliptic Curve Cryptography, but didn't understand it: > The primary security in ECC is the parameter $n$; where $n$ is Order of point $G$, that is $n$ is the smallest positive integer such that $nG = O$, where $G$ is a base point represented by $G= (x_g, y_g)\ on\ E (F...
The *Inhomogeneous Short Integer Solution* (ISIS) problem is as follows: given an integer $q$, a matrix $A \in \mathbb Z^{n\times m}_q$, a vector $b\in \mathbb Z^n_q$, and a real $\beta$, find an integer vector $e\in \mathbb Z^m$ such that $Ae = b \mod q $ and $||e||_2 \leq \beta$. Now assume $e_0$ is a solution to ...
The "How" is already explained well by others, but as far I can see, nobody wrote about "*What* does asymmetric encryption do?". It does **not**, as many think, magically allow two parties Alice and Bob to communicate *securely* over a public channel. Instead, given an *authentic* channel from Alice to Bob *at an...
Propose a symmetric key based crypto-system for implementing a secure email system. This system is based on AES and CCA secure. Suppose that you have to encrypt a large message and that this message is split in several small packets and the crypto-system I mentioned before is used to encrypt each one of the packe...
is this crypto-system secure?
Two users A and B decided to share a file of same size and transfer data bit by bit. And at the end of exchange, A will have B's data and B will have A's data. 1. Assuming, A starts to transfer the first bit, is the protocol considered fair? 2. If both of them do not know in real world, should trust issue be put ...
I was doing some self-initiated knowledge gathering about digests, signatures and hmacs and I ran across the fact that you can use CBC as a MAC, but if the message size is not fixed; then it is not secure. In layman's terms why is this so? Lets say that Johnnyboy has sent a message to QueenElizabeth so a being the ...
How can CBC-MAC be secure when message length is fixed?
I am encrypting files using AES/CBC/PKCSPadding, with 256 bits long keys. So far the first 16 bytes of each encrypted file are the IV. I would like to store some more information regarding the algorithm used, key length, mode and padding at least. This will be useful I think for two reasons: a) I can scan the ...
The primary security of elliptic curves is the "elliptic curve discrete logarithm" problem. In short it goes like this: Take a point $G$ on the elliptic curve $E$. Someone calculates point $P = h*G$ where $h$ is some secret number (this can be done with point addition and duplications fast). Your task: Given public ...
<The primary security of elliptic curves is the "elliptic curve discrete logarithm" problem. In short it goes like this: Take a point $G$ on the elliptic curve $E$. Someone calculates point $P = h*G$ where $h$ is some secret number (this can be done with point addition and duplications fast). Your task: Given public...
I was doing some self-initiated knowledge gathering about digests, signatures and hmacs and I ran across the fact that you can use CBC as a MAC, but if the message size is not fixed; then it is not secure. In layman's terms why is this so? Lets say that Johnnyboy has sent a message to QueenElizabeth so a being the ...
In elliptic curves for cryptography, I know $nG=O$, where $G$ is a base point represented by $G=(xg,yg)\ on\ E(FP)$, where $n$ is Order of point $G$ For example, $P(0,6)$ is a primitive point on the elliptic curve $y^2\equiv x^3+2x+2 \mod 17$. I ask about points on elliptic curve. How many numbers point that is ge...
How many of primitive point on the elliptic curve?
In elliptic curves for cryptography, I know $nG=O$, where $G$ is a base point represented by $G=(x_g,y_g)\ on\ E(F_P)$, where $n$ is Order of point $G$. For example, $P(0,6)$ is a primitive point on the elliptic curve $y^2\equiv x^3+2x+2 \pmod{17}$. I ask about points on elliptic curve. How many numbers point th...
I'll assume that the plaintext consists entirely of capital ASCII letters as in the example. By the definition of [Base64][1], there is a straight mapping from the last of every three characters in the plaintext to the last of every four characters in the Base64 encoding (notice that the characters in Base64 codes t...
I'll assume that the plaintext consists entirely of capital ASCII letters as in the example. By the definition of [Base64][1], there is a straight mapping from the last of every three characters in the plaintext to the last of every four characters in the Base64 encoding (notice that the characters in Base64 codes t...
I was doing some self-initiated knowledge gathering about digests, signatures and hmacs and I ran across the fact that you can use CBC as a MAC, but if the message size is not fixed; then it is not secure. In layman's terms why is this so? Lets say that Johnnyboy has sent a message to QueenElizabeth such that *a* b...
I'll assume that the plaintext consists entirely of capital ASCII letters as in the example. By the definition of [Base64][1], there is a straight mapping from the last of every three characters in the plaintext to the last of every four characters in the Base64 encoding (notice that the characters in Base64 codes t...
I'll assume that the plaintext consists entirely of capital ASCII letters as in the example. By the definition of [Base64][1], there is a straight mapping from the last of every three characters in the plaintext to the last of every four characters in the Base64 encoding (notice that the characters in Base64 codes t...
Okay so I have two options for how I would derive two keys for AES encryption and HMAC they are as follows: 1. Run BCrypt on a users passphrase and then use the bouncy castle implementation of HKDF in java to extend the key from 31-bytes to 64-bytes before then splitting the result into two 32-byte keys. 2. Ru...
Out of curiosity why we can't implement AES 512 key size? Please explain somehow i can understand! I'm not an expert.
Why we can't implement 512 key size AES?
Suppose a hash function based on Merkle-Damguard construction. Its compression function is given as $H_i=E_{m_i}(H_{i-1})$, where $E_{m_i}()$ denotes the encryption of an ideal block cipher with $n$-bit block size. What is the lowest complexity to find an preimage of this hash function? Answer: By applying meet-in-t...
Why we can't implement AES 512 key size?
I'll assume that the plaintext consists entirely of capital ASCII letters as in the example. Frequency analysis of the last character of 4-char blocks in ciphertext -- By the definition of [Base64][1], there is a straight mapping from the last of every three characters in the plaintext to the last of every four ch...
Can it be proven that attacker can obtain the full message if he knows some plain-ciphertext pairs?
How does chosen ciphertext attack work on Elgamal work?
I'll assume that the plaintext consists entirely of capital ASCII letters as in the example. Frequency analysis of the last character of 4-char blocks in ciphertext -- By the definition of [Base64][1], there is a straight mapping from the last of every three characters in the plaintext to the last of every four ch...
We can't implement _"AES 512 key size"_ because AES is [defined][1] for key sizes $k\in\{128,192,256\}$ bits only; much like we can't make a bicycle with 4 wheels. I see no reason why we would _want to_ implement an AES variant with 512-bit key size (since AES-128 is safe enough for <strike>anything foreseeable</str...
How does chosen ciphertext attack on Elgamal work?
ECDSA has the undesirable property that if a key pair reuses a nonce in a signing operation, the cryptosystem experiences catastrophic failure in the form of private key leakage. I've heard this referred to as "sudden death" cryptography. Of course the PS3 misuse of ECDSA is probably the most widely publicised incident...
Why is Poly1305 popular given its 'sudden death' properties?
*Is this true? Are block ciphers considered to be FPE?* Well not exactly . Its something more than block ciphers. Of course block ciphers are integral to FPE. Some times we need to preserve the lengths but some times we need to preserve the lengths of encoded strings. Lets see some examples. Informally, In o...
I have to randomly generate a number $u$ such that $u \in J(N)-Q(N)$ What is the best time-efficient way to generate it ? I am thinking to generate like this . 1) Select an positive integer $x < \sqrt{N-1}$ and calculate $x^2,(x+1)^2$. 2) Check for a number $y$ between $x^2,(x+1)^2$ such that $\big{(}\fra...
Here's the problem: I have a transport stream that I have been requested to encrypt between the transmitter and receiver. The data size is at most 8 bytes so it seems I can only use ECB as I only have a single block - the most I can do is pad to 8 bytes if its less, which I intend to do with random data (the receiver c...
Block cipher to encrypt 8 bytes/64 bits - Use 64 or 128 bit cipher?
I am searching for a secure algorithm to encrypt base62 (or any other base) data for ids in urls. **It should feature:** - No blocksize etc, limiting the length of the message to a factor of n - If you have the decryted and the encrypted message you should not be able to guess the key - An avalanche effect ...
the main question of this message is how to get the true ciphertext from S/MIME file? I created RSA keys and encrypted a message with S/MIME as follow : 1) generate private key : openssl genrsa -out maCle.pem 1024 2) create certificate(public key) : openssl req -new -x509 -key privkey.pem -out certif.p...
I have to randomly generate a number $u$ such that $u \in J(N)-Q(N)$ where $J(N)$ denotes the set of elements less than $N$ , whose Jacobi symbol value is equal to 1 and $Q(N)$ denotes the set of quadratic residues in $J(N)$ . What is the best time-efficient way to generate it ? I am thinking to generate l...
I have to randomly generate a number $u$ such that $u \in J(N)-Q(N)$ where $J(N)$ denotes the set of elements less than $N$ , whose Jacobi symbol value is equal to 1 and $Q(N)$ denotes the set of quadratic residues in $J(N)$ . What is the best time-efficient way to generate it ? I am thinking to generate l...
I have to randomly generate a number $u$ such that $u \in J(N)-Q(N)$ where $J(N)$ denotes the set of elements less than $N$ , whose Jacobi symbol value is equal to 1 and $Q(N)$ denotes the set of quadratic residues in $J(N)$ . What is the best time-efficient way to generate it ? I am thinking to generate l...
The weakness of double DES, `E (k1, E(k2, M))` is that `Meet-in-the-middle` attack is possible. When performing Meet-in-the-middle attack, we first need to build the table with the first column all the possible keys and the second column all the encryption with these keys, then second step is sorting the second column,...
I have to randomly generate a number $u$ such that $u \in J(N)-Q(N)$ where $J(N)$ denotes the set of elements less than $N$, whose Jacobi symbol value is equal to 1; and $Q(N)$ denotes the set of quadratic residues in $J(N)$ . What is the best time-efficient way to generate it ? I am thinking to generate l...
I have been trying to solve the next problem: let pi be a perfect secrecy cryptosystem with specific plaintext probability distribution. How to prove pi will have perfect secrecy for all other possible plaintext probability distributions?
how openSSL RSA work ? I generate public (n,e) and private key (n,d) then I encypted a file by : openssl rsautl -encrypt -in plaintextFile -inkey privkey.pem -out cipher00 let's note the result C and I tried to decrypt it by doing C^d (modulo n) but it doesn't work. I think this is because openssl ad...
how OpenSSL RSA work ? I generate public (n,e) and private key (n,d) then I encypted a file by : openssl rsautl -encrypt -in plaintextFile -inkey privkey.pem -out cipher00 let's note the result C and I tried to decrypt it by doing C^d (modulo n) but it doesn't work. I think this is because OpenSSL ad...
We can't implement _"AES 512 key size"_ because AES is [defined][1] for key sizes $k\in\{128,192,256\}$ bits only; much like we can't make a bicycle with 3 wheels. I see no reason why we would _want to_ define an AES _variant_ with 512-bit key size (since AES-128 is safe enough for <strike>anything foreseeable</stri...
First of all, this is not a beginner's question since I already know a good deal about encryption and brute-force attacks. This is also no question on how to code programs for brute-force attacks since I already know that too and as you can see below I have already coded such a tool. This is more of a set of questions ...
We can't implement _"AES 512 key size"_ because AES is [defined][1] for key sizes $k\in\{128,192,256\}$ bits only; much like we can't make a bicycle with 3 wheels. I see no reason why we would _want to_ define an AES _variant_ with 512-bit key size (since AES-128 is safe enough for <strike>anything foreseeable</stri...
Propose a symmetric key based crypto-system for implementing a secure email system. This system is based on AES and CCA secure. Suppose that you have to encrypt a large message and that this message is split in several small packets and the crypto-system I mentioned before is used to encrypt each one of the packe...
We can't implement _"AES 512 key size"_ because AES is [defined][1] for key sizes $k\in\{128,192,256\}$ bits only; much like we can't make a bicycle with 3 wheels. I see no reason why we would _want to_ define an AES _variant_ with 512-bit key size (since AES-128 is safe enough for <strike>anything foreseeable</stri...
We can't implement _"AES 512 key size"_ because AES is [defined][1] for key sizes $k\in\{128,192,256\}$ bits only; much like we can't make a bicycle with 3 wheels. I see no reason why we would _want to_ define an AES _variant_ with 512-bit key size (since AES-128 is safe enough for <strike>anything foreseeable</stri...
Suppose $n$ actors each hold a plaintext $p_i$. We wish to find $\sum p_i$, without leaking any information about individual $p_i$. Any actor (or any link in the network) could be controlled by an active adversary. More precisely, these protocols can be proved secure against a polynomial time bounded adversary who can ...
Suppose $n$ actors each hold a plaintext $p_i$. We wish to find $\sum p_i$, without leaking any information about individual $p_i$. Any actor (or any link in the network) could be controlled by an active adversary. More precisely, these protocols can be proved secure against a polynomial time bounded adversary who can ...