instruction
stringlengths
15
30k
It matters in the case where one of the ciphers is weaker more than the other two. Let us suppose that for some reason there was an attack on 3DES that reduced it's key space to $2^{40}$ and Rijndael/AES and Serpent to $2^{56}$. Further, for simplicity, suppose that we have only two possible messages $m_1$ and $m_2...
How can I know if I am generating a secure pseudorandom initialization vector? Currently I am planning to generate a pseudo-random initialization Vector using current date and time - is this secure enough? If the answer depends on the block cipher and mode of operation, I am using OFB mode with AES.
Is my pseudo-random initialization vector secure?
i am creating some primitive demostration for ECDSA over small curve ( p < 229). But my implementation have some weird issues. Verify process return false even if the signature is correct. Because I am testing it for some time, trying to find problem I discovered that verify work only if point order is prime. So my...
It matters in the case where one of the ciphers is weaker more than the other two. Let us suppose that for some reason there was an attack on 3DES took $O(2^{40})$ but would guarantee you the plaintext value for a ciphertext. Assume further that there is an attack that reduces Rijndael/AES and Serpent's key space...
If an encryption algorithm is meant to convert a string to another string which can then be decrypted back to the original, how could this process involve any randomness? Surely it has to be deterministic, otherwise how could the decryption function know what factors were involved in creating the encrypted string? ...
How can encryption involve randomness?
Well, the idea behind randomized encryption is that a single plaintext $P$ can encrypt into many different ciphertexts $C_1, C_2, ..., C_n$, and that when we encrypt, we pick one of those ciphertexts randomly. Of course, because the decryptor has no way to knowing apriori which one we picked, it must be able to map an...
How to generate a session key between two nodes in two different subnets when the nodes don't know each other directly, using diffie hellman algorithm?
How do I generate a session key using the Diffie Hellman algorithm?
**Preface:** This question was originally asked on [Theoretical Computer Science][1], and the kind people there referred me to this web site. It is being repeated here in an attempt to find a satisfying answer. *** Over the years, two novel encryption techniques have come to mind and been implemented as programmi...
After implementing a novel encryption algorithm, how would one go about analyzing its security or get help from others in doing so?
I'm playing around with work-factor hash functions, and I'm looking for a memory-hard operation to make it resistant to GPU / parallel hardware attacks. I considered a very large (i.e. 64K) s-box that gets shuffled based on the state per round, but I have a feeling that there are ways to optimise such an operation for ...
First, **why** did you invent your novel algorithms? What problem were you trying solve, what are the advantages and the trade-offs of your algorithms? I assume you have read Bruce Schneier's [Applied Cryptography](http://www.schneier.com/book-applied.html) and can compare your algorithms with others. You can try to...
I don't really understand Galois fields, but I've noticed they're used a lot in crypto. I tried to read into them, but quickly got lost in the mess of heiroglyphs and alien terms. I understand they're sets of the form $GF(p^n)$ for $n\geq1$ where $p$ is prime and $n$ is an integer. From what I can tell, they're defined...
I don't really understand Galois fields, but I've noticed they're used a lot in crypto. I tried to read into them, but quickly got lost in the mess of heiroglyphs and alien terms. I understand they're sets of the form $GF(p^n)$ for $n\geq1$ where $p$ is prime and $n$ is an integer. From what I can tell, they're defined...
Linear feedack shift register tap charts are availale for registers of length 3 to 168. Does anyone have a chart for register lengths from 168 to 256 or beyond? Thank you.
I don't really understand Galois fields, but I've noticed they're used a lot in crypto. I tried to read into them, but quickly got lost in the mess of heiroglyphs and alien terms. I understand they're sets of the form $GF(p^n)$ for $n\geq1$ where $p$ is prime and $n$ is an integer. From what I can tell, they're defined...
Linear feedback shift register tap charts are availale for registers of length 3 to 168. Does anyone have a chart for register lengths from 168 to 256 or beyond? Thank you.
What's the standard way to express "$x$ knows about $y$", or "$x$ has no knowledge of $y$" in cryptographic notation? Example (PRNG predictor): $\exists f : P(f(G(k)|_{0..n}) = G(k)|_{n+1}) \geq 0.5 + \epsilon$, for non negligable $\epsilon$, **where $f$ has no knowledge of $k$**.
**What is the harm if I publish an encrypted RSA private key publicly?** Or in this case, what is the harm if I publish many thousands or millions of them? Assuming that the private key is encrypted with a good password (such as one derived via PBKDF2 or such) and that it's not obvious what the key is used for, is ...
What is the harm if I publish an encrypted RSA private key publicly?
**What is the harm if I publish an encrypted RSA private key publicly?** Or in this case, what is the harm if I publish many thousands or millions of them? Assuming that the private key is encrypted with a good password (such as one derived via PBKDF2 or such) and that it's not obvious what the key is used for, is ...
**Preface:** This question was originally asked on [Theoretical Computer Science][1], and the kind people there referred me to this web site. It is being repeated here in an attempt to find a satisfying answer. *** Over the years, two novel encryption techniques have come to mind and been implemented as programmi...
**Preface:** This question was originally asked on [Theoretical Computer Science][1] and later on [Computer Science](http://cs.stackexchange.com/questions/2053/after-implementing-a-novel-encryption-algorithm-how-would-one-go-about-analyzin#question). The kind people on cstheory.SE referred me to this web site. It is be...
![enter image description here][1] ![enter image description here][2] [1]: https://i.stack.imgur.com/HyRg4.png [2]: https://i.stack.imgur.com/0dcPU.png between the two, what is the true step in AES decryption? because In the first Image, the mixcolumn will come first before the addroundkey while in t...
What is the true AES decryption between the two?
In Inverse Add Round Key in AES, what will I XOR first to the Sub bytes Result? is it the 10th round key? ex. addRoundKey(subBytes,roundKey10); addRoundKey(subBytes,roundKey09); addRoundKey(subBytes,roundKey08); addRoundKey(subBytes,roundKey07); addRoundKey(subBytes,roundKey06); addRoundKey(subBytes,roundKey0...
In Inverse Add Round Key in AES, what will I XOR first to the Sub bytes Result? is it the 10th round key? ex. addRoundKey(subBytes,roundKey10); addRoundKey(subBytes,roundKey09); addRoundKey(subBytes,roundKey08); addRoundKey(subBytes,roundKey07); addRoundKey(subBytes,roundKey06); addR...
I found these images depicting the AES decryption process: ![enter image description here][1] ![enter image description here][2] In the first image, the MixColumns step comes before the AddRoundKey step, while in the second image, the AddRoundKey will come before the MixColumns. Which order is the correct one...
Does the MixColumns step come before or after AddRoundKey in AES decryption?
What is the time complexity of the RC4 encryption & decryption algorithms?
To answer your question "After implementing a novel encryption algorithm, how would one go about analyzing its security", well, the easy answer is "no, it's not secure". The reason I can confidently give that answer is that you're a newbee, and newbee ciphers are never secure (unless they are massively overcomplicated...
To answer your question "After implementing a novel encryption algorithm, how would one go about analyzing its security", well, the easy answer is "no, it's not secure". The reason I can confidently give that answer is that you're a newbee, and newbee ciphers are never secure (unless they are massively overcomplicated...
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $H$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $C$ that transforms message $m$ into $$C(m) = H(m||k)$$ where $||$ denotes concatenation and $k$ is a secret key (constant,...
Attacks of the MAC construction H(m||k) for common hashes H?
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,x) \mapsto \mathcal{C}(k,x)=\mathcal{H}(x||k)$$ where $||$ denotes concatenation, $k$ is a s...
Attacks of the MAC construction $\mathcal{H}(m||k)$ for common hashes $\mathcal{H}$?
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,x) \mapsto \mathcal{C}(k,x)=\mathcal{H}(x||k)$$ where $||$ denotes concatenation, $k$ is a s...
Do all the Cryptographic hashing algorithms operate only on integers (32 bit or 64 bit)? Is there any operation performed on Floating Point Numbers as well? The reason I ask this is because I read here that there are no floating point calculations performed in hashing algorithms and hence FLOPS do not matter: htt...
Do Cryptographic Hashing Algorithms operate only on Integers?
Well, the idea behind randomized encryption is that a single plaintext $P$ can encrypt into many different ciphertexts $C_1, C_2, ..., C_n$, and that when we encrypt, we pick one of those ciphertexts randomly. Of course, because the decryptor has no way to knowing apriori which one we picked, it must be able to map an...
The $GF$ in $GF(p^n)$ is _not_ a function &mdash; it just stands for "Galois field (of $p^n$ elements)". As for what a [Galois field](http://en.wikipedia.org/wiki/Galois_field) _is_, it's a finite set of things (which we might represent e.g. with the numbers from $0$ to $p^n-1$), with some mathematical operations (s...
I don't really understand Galois fields, but I've noticed they're used a lot in crypto. I tried to read into them, but quickly got lost in the mess of heiroglyphs and alien terms. I understand they're sets of the form $GF(p^n)$ for $n\geq1$ where $p$ is prime and $n$ is an integer. From what I can tell, they're defined...
i read this recently: http://www.newscientist.com/article/dn12786-quantum-cryptography-to-protect-swiss-election.html and some parts of this: http://en.wikipedia.org/wiki/Quantum_key_distribution they talk about direct fibre optic cable and evesdropping that seems passive. i want to know whether quantum key di...
Is quantum key distribution safe against MITM attacks too?
I wrote my own cipher to encrypt messages. I would like to test a sample ciphered message to see how strong it is. Are there any tools for such task either in Windows or Linux ?
Brute force a ciphered message?
Ok so you probably know that fields are interesting structures to study...they are places where arithmetic works nicely. Most cryptosystems depending heavily on numbers usually must take the numbers from some field in order for things to work out. Now there are many fields with infinitely many elements, $\mathbb{Q},...
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathcal{H}(m||k)$$ where $||$ denotes concatenation, $k$ is a s...
The $GF$ in $GF(p^n)$ is _not_ a function &mdash; it just stands for "Galois field (of $p^n$ elements)". As for what a [Galois field](http://en.wikipedia.org/wiki/Galois_field) _is_, it's a finite set of things (which we might represent e.g. with the numbers from $0$ to $p^n-1$), with some mathematical operations (s...
It is known that setting the secret key to a fixed, public value does not make MACs like [CBC-MAC](http://en.wikipedia.org/wiki/CBC-MAC) or [GMAC](http://en.wikipedia.org/wiki/Galois/Counter_Mode) into **secure** *unkeyed* cryptographic hash functions that could be used - for instance - for digital signatures. In o...
Which MACs can be converted into a secure unkeyed hash function?
It is known that setting the secret key to a fixed, public value does not make MACs like [CBC-MAC](http://en.wikipedia.org/wiki/CBC-MAC) or [GMAC](http://en.wikipedia.org/wiki/Galois/Counter_Mode) into **secure** *unkeyed* cryptographic hash functions that could be used - for instance - for digital signatures. In o...
It is known that setting the secret key to a fixed, public value does not make MACs like [CBC-MAC](http://en.wikipedia.org/wiki/CBC-MAC) or [GMAC](http://en.wikipedia.org/wiki/Galois/Counter_Mode) into **secure** *unkeyed* cryptographic hash functions that could be used - for instance - for digital signatures. In o...
It is known that setting the secret key to a fixed, public value does not make MACs like [CBC-MAC](http://en.wikipedia.org/wiki/CBC-MAC) or [GMAC](http://en.wikipedia.org/wiki/Galois/Counter_Mode) into **secure** *unkeyed* cryptographic hash functions that could be used - for instance - for digital signatures. In o...
Why is encoding using the private key used for signing? Wouldn't it make sense to keep the premise, that private is for decoding and public is for encoding? i.e. create a hash and threat it as a result of the crypting and decrypt it. The decrypted value being the "signature". Than when someone want to validate the sign...
RSA/DSA: Wouldn't it make sense to sign using decoding the data hash?
In the *Add Round Key* step in AES decryption, which part of the expanded key will I XOR first to the result of the SubBytes step? Is it the 10th round key? For example, is this the right order? addRoundKey(subBytes,roundKey10); addRoundKey(subBytes,roundKey09); addRoundKey(subBytes,roundKey08); ...
In which order are the round keys used during AES decryption?
How can SSL secure a two-way communication with only one key-pair?
RFC 4880 describes the version 4 signature packet, tag 2, as - One-octet signature type. - One-octet public-key algorithm. - One-octet hash algorithm. - Two-octet scalar octet count for following hashed subpacket data. Note that this is the length in octets of all of the hashed subpac...
I'm a total newb to cryptography but after reading what I've read about it, I had a simple idea and I wonder if it has any merit. What if you encrypted using a selection of hash algorithms applied sequentially instead of one, or multiple iterations of the same one? Which hash algorithms to apply and/or in what order co...
Applying multiple hash functions to improve security?
The fact is I'm not quite sure if my question statement is true, however all the MAC constructions I know of (e.g. CBC-MAC, CMAC, HMAC) are deterministic, whereas many constructions for digital signature are randomized (e.g. DSA, ECDSA, RSASSA-PSS). I also know that RSASSA-PKCS1.5 is deterministic but still considered ...
Why are MACs in general deterministic, whereas digital signature constructions are randomized?
The fact is I'm not quite sure if my question statement is true, however all the MAC constructions I know of (e.g. CBC-MAC, CMAC, HMAC) are deterministic, whereas many constructions for digital signature are randomized (e.g. DSA, ECDSA, RSASSA-PSS). I also know that RSASSA-PKCS1.5 is deterministic but still considered ...
I am developing an application that sends messages which I want to encrypt and sign. The CryptoApi offers a function called [CryptSignAndEncryptMessage][1]. The description says, what this function actually does: > The **CryptSignAndEncryptMessage** function creates a hash of the > specified content, signs the has...
Safely use CryptSignAndEncryptMessage?
I am trying to achieve the following: Encrypted files are stored on users filesystem. The user uses my client to authenticate against a server. Once he is authenticated successfully he gets a token to decrypt the files. things i want to ensure: the user should not be able to cache the token for later use. like a ...
I don't think that's possible, at least not without the kind of intrusive mechanisms you'd need for reliable [DRM](http://en.wikipedia.org/wiki/Digital_rights_management). Basically, if the user gets a key that lets them decrypt the files, what's to stop them from just decrypting them all and keeping the decrypted v...
I have ask as part of my answer, "What problem are you trying to solve?" Do you want a secure unkeyed hash function? If you do, then there are plenty of them around. Even some of the ones that are broken for some uses might be okay for yours (SHA-1 springs to mind -- note the discussion above on HMAC and how broken ...
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathcal{H}(m||k)$$ where $||$ denotes concatenation, $k$ is a s...
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathcal{H}(m||k)$$ where $||$ denotes concatenation, $k$ is a s...
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathcal{H}(m||k)$$ where $||$ denotes concatenation, $k$ is a s...
A particular educational software program published by a U.S. government agency uses a variant of RC4 to obfuscate its data files (see [Stack Overflow question](http://stackoverflow.com/questions/4334944/how-can-i-defeat-rc4-like-obfuscation)). The variant of RC4 in question is identical to standard RC4 except at the b...
Does omitting the first two lines of RC4's pseudorandom generation algorithm weaken the cipher?
A particular educational software program published by a U.S. government agency uses a variant of RC4 to obfuscate its data files (see [Stack Overflow question](http://stackoverflow.com/questions/4334944/how-can-i-defeat-rc4-like-obfuscation)). The variant of RC4 in question is identical to standard RC4 except at the b...
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathcal{H}(m||k)$$ where $||$ denotes concatenation, $k$ is a s...
> **Possible Duplicate:** > [Guarding against cryptanalytic breakthroughs: combining multiple hash functions](http://crypto.stackexchange.com/questions/270/guarding-against-cryptanalytic-breakthroughs-combining-multiple-hash-functions) <!-- End of automatically inserted text --> I'm a total newb to cryptography b...
>If I understood correctly, this solution could be susceptible to an attack called surreptitious forwarding? If CryptSignAndEncryptMessage is implemented in the naive way, then it would seem that it is vulnerable to a forwarding attack. Microsoft has not published the exact details (AFAIK), so it is difficult to tel...
**Yes**, that omission weakens the cipher: the output $\mathtt K$ has a short cycle (at most 65280 bytes) for a sizable class of keys (one in 65536). Not initializing $\mathtt i$ makes no difference in the values of $\mathtt i$ effectively used for the rest of the algorithm, since $0\equiv 256 \pmod{256}$; and henc...
In the first decade of the 21th century, and counting, on a given $Year$, no RSA key bigger than $(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 long-term predictions ...
Consider a common practically-collision-resistant [Merkle–Damgård][1] hash function $\mathcal{H}$ (e.g. [SHA-1][2], [RIPEMD-160][3], [SHA-256][4], [SHA-512][5]). We define a [Message Authentication Code][6] $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathcal{H}(m||k)$$ where $||$ denotes concatenation, $k$ is a s...
Let's think of the following case: A group of peers want to exchange messages with each other. They use public-key cryptography to sign and encrypt messages. Anyone with any name can join the network. There is no central trusted authority, such as a CA that could issue certificates. When a peer joins, he publishes...
When to prefer exchanging cryptographic certificates over exchanging only public keys?
Well, the obvious problem with just exchanging public keys is, in fact, there is no way of knowing whether a peer who claims a name really has this name. If you are using the name to make cryptographical policy decisions, this is a problem. As an obvious example, Eve can join the group and claim to be Bob; there's ...
4. In the SHA hash algorithm: (a) the message is always padded, even if initially the correct length without padding; (b) the padding is of the form "1" followed by the necessary number of 0s. Why?
Please help! In the SHA hash algorithm, why is the message always padded?
Without padding always being added, there is a trivial second preimage attack. For simplicity let's assume a 10 bit hash function $h_{10}$ (extending this to other size hash functions is trivial). Let $m_1=101$ and $m_2=1011000000$. I claim that $h_{10}(m_1)=h_{10}(m_2)$. Since $m_2$ is 10 bits, no padding is nee...
In the SHA hash algorithm the message is always padded, even if initially the correct length without padding; the padding is of the form "1" followed by the necessary number of 0s. Why is it necessary that the message always be padded?
In the SHA hash algorithm, why is the message always padded?
I'm currently working on an application that requires me to add two ECDSA private keys in order to make a new private key. The result has to have the property, that its corresponding public key is the same as one would sum the public keys corresponding to the first private keys. I managed to get most of that going, ...
How to properly add ECDSA private keys?
I was given a ciphertext and now I am trying to break it via looking for the keyword. Just a little info. This is a keyword cipher. So: PlainEnglish: ABCDEFGHIJKLMNOPQRSTUVWXYZ If keyword is HELLO CipherLetters: HELOABCDFGIJKMNPQRSTUVWXYZ So, I had done a little frequency analysis where I've managed to g...
How to get the keyword from a keyword cipher?
I was given a ciphertext and now I am trying to break it via looking for the keyword. This is a keyword cipher. So: PlainEnglish: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` If keyword is `HELLO`, CipherLetters: `HELOABCDFGIJKMNPQRSTUVWXYZ` So, I had done a little frequency analysis where I've managed to get the percen...
Let's start by considering which cipher letters should correspond to the most common letters `E` and `T`. According to your frequency analysis, the most likely candidates are `O`, `K`, `T` and maybe `D` and `N`. Now, `E` is the fifth letter of the alphabet, so unless your keyword is very short, it's going to encryp...
In normal LFSR, the state is a function of the initial seed, taps positions and time, nothing else. I've seen a modification of LFSR that works like this: i = 0 k = [...] #elements smaller than bitlength of state while True: state = state ^ (1<<k[i]) state = tick(state) i += ...
Say I have a [request-response][1] protocol and the task to make it immune to [replay attacks][2]. The requirements are as follows: 1. The defense mechanism cannot rely on the clocks of the parties. 2. The defense mechanism should work even when requests are not sequential. 3. No party can store more than 1KB o...