instruction
stringlengths
15
30k
May be a silly question, but I am really curious. If a hash algorithm uses Base64 in the process of hashing a string for example, it is still considered a hash algorithm, even though it uses an encoding algorithm in it's process?
I read the document(not the whole document) from Shannon where he speaks about the concepts of confusion and diffusion. I read in many places(not in the document but around the internet) that confusion is enforced using substitution. Diffusion is enforced using permutation/transposition. Ciphers must use both of them b...
(Crypto Gods, I should begin by stressing that I haven't lost my mind: I'm not doing this in real life, I'm just trying to understand the theory behind what's happening. With your help, hopefully I can do that.) Let's say I choose the parameters for a linear congruential generator $L$, and pick a seed $L_0$. I then ...
What's causing the poor randomness in this program: the LCG, or the program logic itself?
I am looking at G now, but is there a better, (in terms of security and speed), means by which a byte array can be expanded that doesn't involve another cipher, just a method? I need to expand 1024 bytes to 4096, and speed is less important than overall distribution of entropy. I am also trying to find something that i...
I am looking at G now, but is there a better, (in terms of security and speed), means by which a byte array can be expanded that doesn't involve another cipher, just a simple algorithm? I need to expand 1024 bytes to 4096 for use in a stream cipher, and speed is less important than overall distribution of entropy. I...
What is the most secure key expansion routine?
This is for [a challenge at followthewhiterabbit.trustpilot.com][1]: > Knowns: > - The algorithm is AES (Rijndael) - Blocksize: 128 - Keysize: 256 - You only need to find the first 6 bytes of the key, the rest are 0’s, so: [?,?,?,?,?,?,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] - All bytes in ...
In FIPS 186-4, page 41, about FFC crypto it is required that the length of p will be exactly 1024 bit and the length of q will be exactly 160 bit. Why the requirement is not stated in terms of lower bounds? for instance, any p with length greater than 1024 bit would be good, and any q with length greater than 160 bit w...
Why FIPS 186-4 requires specific sizes for keys?
CryptDB has Onion layers of Encryption to provide wider functionality from weaker forms of encryption. How do we prove such things are indeed secure ? Intuitively It seems ok. Are there any parallels in theory that is related say, security multiple encryption schemes etc? or Universal Composability etc?
How to prove Security of Onion Layers of encryption?
CryptDB has Onion layers of Encryption to provide wider functionality from weaker forms of encryption. How do we prove such things are indeed secure ? Intuitively It seems ok. Are there any parallels in theory that is related say, security of multiple encryption schemes etc? or Universal Composability etc?
In [FIPS 186-4, page 41][1], about FFC crypto it is required that the length of $p$ will be exactly 1024 bit and the length of $q$ will be exactly 160 bit. Why is not the requirement stated in terms of lower bounds? For instance, any $p$ with length greater than 1024 bit would be good, and any $q$ with length greater t...
Padding oracle attacks are a huge nuisance when using CBC mode encryption without authentication. Wouldn't all those padding oracle attacks be avoided if we'd just use bit padding instead? Or is does bit padding also leak information during decryption?
An answer surfaced from careful reading of appropriate documentation. The MAC in the question is also defined in ANSI X9.19, and is supported by some PKCS#11 tokens as the mechanism [CKM_DES3_X919_MAC][1], or something on that tune. Other than that, this MAC can be simulated using CKM_DES_MAC (or CKM_DES_CBC) for...
Two of the properties that lead to the design of DES S-Boxes are: 1)For any non-zero 6-bit difference between inputs, no more than 8 of the 32 pairs of inputs exhibiting that difference may result in the same output difference. 2)This is a criterion similar to the previous one, but for the case of three S-boxes...
In the following picture k is the key length and n is the block size. I understand that {0,1}^k means all possible combination of keys and {0,1}^n means all possible combination of a plain-text block. But I don't understand the overall equation, specially the meaning of the arrow (in blue). Can anyone explain it in bri...
In [FIPS 186-4, page 41][1], about FFC crypto it is required that the length of $p$ will be exactly 1024 bit and the length of $q$ will be exactly 160 bit. Why is the requirement not stated in terms of lower bounds? <br> For instance, any $p$ with length greater than 1024 bit would be good, and any $q$ with length gr...
Why does FIPS 186-4 require specific sizes for keys?
In the following picture $\kappa$ is the key length and $n$ is the block size. I understand that $\{0,1\}^\kappa$ means all possible combination of keys and $\{0,1\}^n$ means all possible combination of a plain-text block. But I don't understand the overall equation, specially the meaning of the arrow $\to$. Can ...
What does $\to$ mean in the following definition of a block cipher?
CryptDB has Onion layers of Encryption to provide wider functionality from weaker forms of encryption. How do we prove such things are indeed secure ? Intuitively It seems ok. Are there any parallels in theory that is related say, security of multiple encryption schemes etc? or Universal Composability etc? Is this s...
In [FIPS 186-4, page 32][1], about FFC crypto it is required that the length of $p$ will be exactly 1024 bit and the length of $q$ will be exactly 160 bit. Why is the requirement not stated in terms of lower bounds? For instance, any $p$ with length greater than 1024 bit would be good, and any $q$ with length greate...
$\def\dbl{\mathrm{dbl}}$Okay, let's give the missing step between mikeazo's and poncho's answers. I assume you've read mikeazo's answer to know how to add and double points. Now, how do we get a scalar multiple of a point? A simple algorithm is called "[double-and-add][1]", as it just does this. In a simple...
Two of the properties that lead to the design of DES S-Boxes are: 1)For any non-zero 6-bit difference between inputs, no more than 8 of the 32 pairs of inputs exhibiting that difference may result in the same output difference. 2)This is a criterion similar to the previous one, but for the case of three S-boxes...
I'm curious about what operations have been implemented as functional encryption schemes. What I mean by that is: what operations can be performed over encrypted ciphertexts? Obviously homomorphic encryption allows for + and *. Deterministic encryption allows for equality comparison (==). Order-preserving encryption al...
Implementable operations supported by functional encryption?
Is there any variant of the Carter-Wegman MAC algorithm that is fast, parallel and has the property of incremental crypto?
I'd like to generate all possible 6-bit to 4-bit S-Boxes that satisfy the criteria for S-Box design given by Coppersmith, but I have a few doubts: 1. How many such S-Boxes are possible? 2. Is there any existing implementation of said boxes? 3. What would be the most efficient way to implement them? An...
Generating S boxes that satisfy Coppersmith's criteria?
How can you efficiently create a pseudorandom permutation with a large domain given a PRP with a small domain? I.E., given an $n$-bit PRP, create an $n k$-bit PRP. I'm only interested in security up to $C 2^{\frac{n}{2}}$ messages, when $C$ is a reasonably-sized constant. For a power-of-2 $k$, the Luby-Rackoff c...
I'd like to generate all possible 6-bit to 4-bit S-Boxes that satisfy the criteria for S-Box design given by Coppersmith, but I have a few doubts: 1. How many such S-Boxes are possible? 2. Is there any existing implementation of said boxes? 3. What would be the most efficient way to implement them? Any help is ...
I'm curious about what operations have been implemented as functional encryption schemes. What I mean by that is: what operations can be performed over encrypted ciphertexts? Obviously homomorphic encryption allows for $+$ and $*$. Deterministic encryption allows for equality comparison ($==$). Order-preserving enc...
How about [GMAC][1]? It meets the requirements of being fast to compute, and parallelizable. In addition, it can be securely updated, that is, given a long message, you can compute the MAC of a modified version of that message faster than recomputing the entire MAC. For example, suppose you have a message/nonce/tag...
How about [GMAC][1]? It's a Carter-Wegman MAC meets the requirements of being fast to compute, and parallelizable. In addition, it can be securely updated, that is, given a long message, you can compute the MAC of a modified version of that message faster than recomputing the entire MAC. For example, suppose you ha...
How about [GMAC][1]? It's a Carter-Wegman MAC that meets the requirements of being fast to compute, and parallelizable. In addition, it can be securely updated, that is, given a long message, you can compute the MAC of a modified version of that message faster than recomputing the entire MAC. For example, suppose y...
How about [GMAC][1]? It's a Carter-Wegman MAC that meets the requirements of being fast to compute, and parallelizable. In addition, it can be securely updated, that is, given a long message, you can compute the MAC of a modified version of that message faster than recomputing the entire MAC. For example, suppose y...
An answer surfaced from careful reading of appropriate documentation. The MAC in the question is also defined in ANSI X9.19, and is supported by some PKCS#11 tokens as the mechanism [CKM_DES3_X919_MAC_GENERAL][1]. Other than that, this MAC can be simulated using CKM_DES_MAC_GENERAL (or CKM_DES_CBC or CKM_DES3_CBC...
Google today announced they are sunsetting SHA1. Its fine by me. But that made me realize I am not keeping up with the research on SHA1. Wiki only says [Steven's attack](http://2012.sharcs.org/slides/stevens.pdf) is the most efficient but its also on a reduced round SHA1 - not the SHA1 with the full rounds. So is there...
Stevens' attack is on full SHA-1, not a reduced round variant. The differentials are on only part of the rounds, but a linear attack extends it to the rest. However, the attack described as "fully working" in the slides you link has still not been used to demonstrate actual collisions, so it's indeed theoretical. Ad...
I'm curious about what operations have been developed into functional encryption schemes. What I mean by that is: what operations can be performed over encrypted ciphertexts? Obviously homomorphic encryption allows for $+$ and $*$. Deterministic encryption allows for equality comparison ($==$). Order-preserving enc...
"Practical" operations supported by functional encryption?
Whenever a ciphertext is decrypted using a block-cypher, we need to remove the padding. There are different ways to add padding, but they usually set the last byte of the last block to the number of padding bytes that were added and need to removed (e.g. we added 5 bytes, so we set the last byte to 0x05). My questio...
Why verify padding at all?
First of all, a more usual padding scheme would add 5 times the same byte 0x05 (in your example) so the check not just removes 5 bytes, but also checks that the 4 bytes before it have the same value. But let's assume your scheme (which is underspecified: what to put in the bytes before? Zeroes, or random values?) for n...
As the question suggests, I wanted to get a sanity-check on this issue... is it the case that the use of a random token exchange during SKID3 authentication itself constitute a prevention of a replay attack, or is there a window of vulnerability in this process (and post-authentication) to this particular attack as we...
Does the initial exchange of random tokens in SKID3 authentication assure against replay attacks?
I'm curious about what operations have been developed into functional encryption schemes. What I mean by that is: what operations can be performed over encrypted ciphertexts? Obviously homomorphic encryption allows for $+$ and $*$. Deterministic encryption allows for equality comparison ($==$). Order-preserving enc...
I'm curious about what operations have been developed into functional encryption schemes. What I mean by that is: what operations can be performed over encrypted ciphertexts? Obviously homomorphic encryption allows for $+$ and $*$. Deterministic encryption allows for equality comparison ($==$). Order-preserving enc...
How can you efficiently create a pseudorandom permutation with a large domain given a PRP with a small domain? Meaning: given an $n$-bit PRP, how can I create an $n k$-bit PRP? I'm only interested in security up to $C 2^{\frac{n}{2}}$ messages, when $C$ is a reasonably-sized constant. For a power-of-2 $k$, the Luby...
How do you create a large PRP from a small one?
Google today announced they are sunsetting SHA-1. Its fine by me. But that made me realize I am not keeping up with the research on SHA-1. The [Wikipedia page][1] only says [Stevens' attack](http://2012.sharcs.org/slides/stevens.pdf) is the most efficient but its also on a reduced round SHA-1 - not the SHA-1 with the f...
Are there valid attacks on full SHA-1?
Is there a known pair of distinct bit strings (A,B) such that SHA-1(A) == SHA-1(B)? If the answer is no than how can SHA-1 be considered broken?
No SHA-1 collision? Yet SHA-1 is broken?
Stevens' attack is on full SHA-1, not a reduced round variant. The differentials are on only part of the rounds, but a linear attack extends it to the rest. However, the [attack][1] (pdf of full paper) described as "fully working" in the slides you link has still not been used to demonstrate actual collisions, so it's ...
While dabbling in privacy-preserving protocols (mainly using Semi-Homomorphic Encryption) and coming up with miscellaneous ideas for comparison tests or other similar primitives, based on obfuscation and a small number of rounds between two parties, I have been consistently opposed the argument that such protocols did ...
Stevens' attack is on full SHA-1, not a reduced round variant. The differentials are on only part of the rounds, but the attack itself extends to the full algorithm. However, the [attack][1] (pdf of full paper) described as "fully working" in the slides you link has still not been used to demonstrate actual collisions,...
Fully homomorphic encryption schemes allow one to evaluate any arbitrary computation over encrypted data. Intuitively this seems to be too weak, irrespective of how we achieve this. An adversary who has access to the cipher text only could do variety of operations. For example, duplicates in the cipher text could b...
Can I remove new lines from the rsa public key file to get a one line string? So the question is if the key looks like this AAA BBB CCC or AAA\n\rBBB\n\rCCC\n\r is this the same as AAABBBCCC
Can I remove new lines in a public key?
I have just read little about the Vernam cipher and the [problems][1] of implementing it. But, **in practice**, would not the key, if generated by a common used programming language´s `Random()` function (like Pyhton´s or Java´s random functions from their standard libraries), be enough to make the message almost un...
Isn´t a simple Vernom cipher as secure as known symmetric key algorithms?
I have just read little about the Vernam cipher and the [problems][1] of implementing it. But, **in practice**, would not the key, if generated by a commonly used programming language's `Random()` function (like Python's or Java's random functions from their standard libraries), be enough to make the message almost ...
Isn't a simple Vernam cipher as secure as known symmetric key algorithms?
Let's say, I have a group $G$ of large prime order $p$. A set $S$ consists of $n$ random elements chosen from $G$. Without using a collision resistant hash function $H$, how can I map elements of $G$ to unique elements in $Z_p$?
How to map arbitrary group elements to unique integers without using Hash functions?
How can I map arbitrary group elements to unique integers without using Hash functions?
While dabbling in privacy-preserving protocols (mainly using Semi-Homomorphic Encryption) and coming up with miscellaneous ideas for comparison tests or other similar primitives, based on obfuscation and a small number of rounds between two parties, I have been consistently opposed the argument that such protocols did ...
I was hoping somebody could explain some issues I have with quantum key exchange that I don't quite understand. I've read bits and pieces about BB84 but I'm sure my questions probably apply to other schemes also. My understanding of quantum key exchange is the following (please correct me if I'm wrong): 1) Alice cre...
I have a few questions I'm stuck on for a cryptography course I'm doing, any help would be much appreciated. The first application is for decryption on a multicore processor. I assume any of ECB, CBC, CFB or CTR would be suitable since decryption would be faster when performed in parallel, but are any of them signif...
Which block cipher mode(s) is most appropriate in these applications?
I was hoping somebody could explain some issues I have with quantum key exchange that I don't quite understand. I've read bits and pieces about BB84 but I'm sure my questions probably apply to other schemes also. My understanding of quantum key exchange is the following (please correct me if I'm wrong): 1. Alice cre...
Let's say, I have a group $G$ of large prime order $p$. A set $S$ consists of $n$ random elements chosen from $G$. Without using a collision resistant hash function $H$, how can I map elements of $G$ to unique elements in $Z_p$? I thought about it before posting here. But, finding discrete logarithm for an arbitrary...
I'm trying to design a protocol for a resource constrained environment. The device has to communicate with a server through an insecure node. My plan is to use AES 256 end to end for all communications. From what I understand, keys carry a risk factor that increases with use and time. From reading this post: http:/...
> The first application is for decryption on a multicore processor. I assume any of ECB, CBC, CFB or CTR would be suitable since decryption would be faster when performed in parallel, but are any of them significantly more suitable than the others and how? CTR, CBC and CFB all allow parallel decryption. CTR allows y...
> 1. Is it necessary to factor time into this equation for devices that communicate infrequently with the same key? No. Time would only matter for attacks that require a lot of processing by the attacker. Basically, key recovery attacks, through either brute force (impossible with AES key size) or maybe weaknesses i...
I'm assuming you mean a base 64 encoded key file, since removing the newlines from a binary file would obviously break things. The RSA standards (e.g. [RFC 2459][1]) only define a binary representation for keys. In practice, like OpenPGP keys ([RFC 4880][2]), they are often encoded in base 64 using the otherwise obs...
In the key generation step of [paillier][1] cryptosystem , In order to satisfy $\gcd(pq,(p-1)(q-1))=1$ , we can take equal [length][2] primes. Instead of taking equal length primes , is there any time efficient method to assure $pq,(p-1)(q-1)$ are relatively prime ? Or is it mandatory to take equal length pri...
In the key generation step of [paillier][1] cryptosystem , In order to satisfy $\gcd(pq,(p-1)(q-1))=1$ , we can take equal [length][2] primes. Instead of taking equal length primes , is there any time efficient method to assure $pq,(p-1)(q-1)$ are relatively prime ? Or is it mandatory to take equal length pri...
I'm assuming you mean a base 64 encoded key file, since removing the newlines from a binary file would obviously break things. The RSA standards (e.g. [RFC 2459][1]) only define a binary representation for keys. In practice, like OpenPGP keys ([RFC 4880][2]), they are often encoded in base 64 using the otherwise obs...
I was hoping somebody could explain some issues I have with quantum key exchange that I don't quite understand. I've read bits and pieces about BB84 but I'm sure my questions probably apply to other schemes also. My understanding of quantum key exchange is the following (please correct me if I'm wrong): 1. Alice cre...
Let’s take your questions in order. Note that I’m a physicist working in quantum cryptography, so my opinion on this might be biased #1. What about authentication ? The classical channel between Alice and Bob has to be authenticated in order for the protocol to work. Formally, this is a pre-requisite for quantum ke...
1. What's to guarantee authentication or message integrity (particularly when Alice and Bob are exchanging which filters were correct and so on)? A pre-authenticated classical channel is an essential requirement in addition to the quantum channel on which the quantum key exchange (QKE) is performed. This implies tha...
1. What's to guarantee authentication or message integrity (particularly when Alice and Bob are exchanging which filters were correct and so on)? A pre-authenticated classical channel is an essential requirement in addition to the quantum channel on which the quantum key exchange (QKE) is performed. This implies tha...
Let’s take your questions in order. Note that I’m a physicist working in quantum cryptography, so my opinion on this might be biased #1. What about authentication ? The classical channel between Alice and Bob has to be authenticated in order for the protocol to work. Formally, this is a pre-requisite for quantum ke...
I refer to an article https://eprint.iacr.org/2011/501. I focus on (a bit modified) **Algorithm 1** which runs as follows (in my understanding): For given $n, m, \overline m\in \mathbb N$, $q=2^k$ and a distribution $\mathcal D$, algorithm chooses a uniformly random matrix $\overline {\mathbf A}\in \mathbb Z_q^{n\time...
Are there cryptographic hash functions that have distributive property? E.g. satisfying following relation `h(a || b) = h(a) · h(b)`, where `h(x)` is hash function itself, `x || y` is concatenation and `x · y` is some hash-specific combination function making single hash given two of them. If that makes any differen...
Cryptographic hash functions with distributive property?
I refer to an article https://eprint.iacr.org/2011/501. I focus on (a bit modified) **Algorithm 1** which runs as follows (in my understanding): For given $n, m\in \mathbb N$, $q=2^k$ and a distribution $\mathcal D$, algorithm chooses a uniformly random matrix $\overline {\mathbf A}\in \mathbb Z_q^{n\times m-nk}$ and ...
I was reading upon Biham and shamir's paper and a fact has been presented over there - if $ P1 = \overline P2$ and I choose a key $K1 = \overline K2$ then in that case $$T1 = DES(P1, K1)$$ $$T2 = DES(P2, K2)$$ then $T1 = \overline T2$ . Does this hold for only that particular combination of s box or it will be ...
I need to implement a simple approach on a Linux system to encrypt/decrypt data and I would appreciate any feedback from you. Basically, I need to change a bit the behavior of the functions read/write. I've checked some options such as EncFS, but they only perform encryption/decryption at file level (decrypt/encryp...
I was reading upon Biham and shamir's paper and a fact has been presented over there - if $ P1 = \overline P2$ and I choose a key $K1 = \overline K2$ then in that case $$T1 = DES(P1, K1)$$ $$T2 = DES(P2, K2)$$ then $T1 = \overline T2$ . Does this hold for only that particular combination of s box or it will be ...
Are there cryptographic hash functions that have distributive-like properties? E.g. satisfying following relation `h(a || b) = h(a) · h(b)`, where `h(x)` is hash function itself, `x || y` is concatenation and `x · y` is some hash-specific combination function making single hash given two of them. If that makes any d...
Cryptographic hash functions with distributive-like properties?
1. What's to guarantee authentication or message integrity (particularly when Alice and Bob are exchanging which filters were correct and so on)? A pre-authenticated classical channel is an essential requirement in addition to the quantum channel on which the quantum key exchange (QKE) is performed. This implies tha...
1. What's to guarantee authentication or message integrity (particularly when Alice and Bob are exchanging which filters were correct and so on)? A pre-authenticated classical channel is an essential requirement in addition to the quantum channel on which the quantum key exchange (QKE) is performed. This implies tha...
So I have been doing for the last couple of days comparison between Feistel cipher and Substitution-permutation network. Now I can say I know a lot obout them and their similarities and differences but there is still one more thing I would like to know and I can't find it anywhere. The thing is I dont know how many ...
I have been thinking about digitally signed documents (Word files and PDF files) and can not get over the fact about - how can I securely know when the file was signed? Scenario: If the date of the signature is saved in the file that I am signing. The voucher for the date is me. However, if someone steals my privat...