instruction
stringlengths
15
30k
While I read that hashes are not meant to be reversible, but assuming we have part/half of the message/input of a hash? Is there any method that we can use to recover the remaining message via this part of the message that we have? Thanks in advance
Can we reverse a hash when we know part of the input?
Reusing a one-time pad?
The CKM_RSA_PKCS Mechanism in [PKCS#11 v2.20 section 12.1.6 _PKCS&thinsp;#1 v1.5 RSA_][1] is a signature scheme commonly used to implement [RSASSA-PKCS1-v1_5 of PKCS#1][2] signature of data hashed externally to a PKCS#11 token (such as an HSM). With an RSA modulus $N$ of $k$ bytes ($2^{8k-8}\le N<2^{8k}$), CKM_RSA_P...
The CKM_RSA_PKCS Mechanism in [PKCS#11 v2.20 section 12.1.6 _PKCS&thinsp;#1 v1.5 RSA_][1] is a signature scheme commonly used to implement [RSASSA-PKCS1-v1_5 of PKCS#1][2] signature of data hashed externally to a PKCS#11 token (such as an HSM). With an RSA modulus $N$ of $k$ bytes ($2^{8k-8}\le N<2^{8k}$), CKM_RSA_P...
There is a stream cipher known to withstand chosen-plaintext attacks. The attacker knows parts of the key so she can reduce the key-space to a size that can be practically brute-forced. However the attacker only accesses some parts of the ciphertext and she doesn't know how many bits she missed (the attacker is out...
I've recently started reading the book "Applied Cryptography" written by Bruce Schneier. Quite a few times I stumbled across protocols who send the identity outside of the encrypted message (see step 4). Is there a certain reason to do so? What does speak against sending the identity within the encrypted message?...
Why not send the identity in the encrypted message?
It has for many years been popular to use RSA keys that have lengths that are powers of two. E.g. 1024-bit, 2048-bit and 4096-bit key lengths are all popular for use with OpenPGP implementations such as GnuPG, and with OpenSSH, etc, and these key lengths are often either defaults in the software generating the keys, or...
There is a stream cipher without any known cryptographic weaknesses. The attacker knows parts of the key so she can reduce the key-space to a size that can be practically brute-forced. However the attacker only accesses some (continuous) parts of the ciphertext and she doesn't know how many bits she missed (the att...
Is RSA-OAEP secure when the exponent is equal to 3?
Is RSA-OAEP secure when e=3?
It has for many years been popular to use RSA keys that have lengths that are powers of two. E.g. 1024-bit, 2048-bit and 4096-bit key lengths are all popular for use with OpenPGP implementations such as GnuPG, and with OpenSSH, etc, and these key lengths are often either defaults in the software generating the keys, or...
Using magic, I've built a machine that instantly generates hash collisions. To try it out, I set the dial to SHA256 and typed in "e7cf3ef4f17c3999a94f2c6f612e8a888e5b1026878e4e19398b23bd38ec221a". I hit the button and it showed me a long sequence of bytes starting with "09F7E02F1290BE211DA707A266F153B3...". I hit th...
What practical uses can random hash collisions be put to?
Is it possible that we take a $PRG$ $G(k)$ of stretch $n.2^n$, and read its output as the table of a $PRF$ $F(K)$ with input and output size of $n$? Intuitively it sounds possible however I read it somewhere that this may not be done.
I want to encrypt a large file using RC4. But what happens if the encrypted file gets corrupted (bytes modified or lost)? Can I still decrypt the rest of the file correctly? If not, what is the best solution? Split the file in X chunks, and encrypt those seperately?
What happens when a RC4 stream gets corrupted?
I have an embedded device. It produces larges files (200 MB). I want the device to encrypt the file before writing to disk, so I gave them all a 16-byte random key. How can I transform the large file with the small key, with the least amount of CPU? If I XOR the data with the 16byte key, its almost good enough....
For any hash functions $H_0$ and $H_1$, it is easily proved that their concatenation $H_0\|H_1$, defined by $(H_0\|H_1)(X)=H_0(X)\|H_1(X)$, is at least as resistant as the strongest of $H_0$ and $H_1$ with respect to collision-resistance, first-preimage-resistance, and second-preimage-resistance. Here we study another ...
For any hash functions $H_0$ and $H_1$, it is easily proved that their concatenation $H_0\|H_1$, defined by $(H_0\|H_1)(X)=H_0(X)\|H_1(X)$, is at least as resistant as the strongest of $H_0$ and $H_1$ with respect to collision-resistance, first-preimage-resistance, and second-preimage-resistance. Here we study another ...
For any hash functions $H_0$ and $H_1$, it is easily proved that their concatenation $H_0\|H_1$, defined by $(H_0\|H_1)(X)=H_0(X)\|H_1(X)$, is at least as resistant as the strongest of $H_0$ and $H_1$ with respect to collision-resistance, first-preimage-resistance, and second-preimage-resistance. Here we study another ...
Suppose we have a secure trapdoor function defined on (G, F, F^-1) where G is a randomized algorithm outputs a key pair (pk, sk). Why would this trapdoor function become insecure if we apply F directly to plaintext message? E(pk,m) = c = F(pk, m)
For any hash functions $H_0$ and $H_1$, it is easily proved that their concatenation $H_0\|H_1$, defined by $(H_0\|H_1)(X)=H_0(X)\|H_1(X)$, is at least as resistant as the strongest of $H_0$ and $H_1$ with respect to collision-resistance, <strike>first preimage resistance,</strike> and second-preimage-resistance. Here ...
For any hash functions $H_0$ and $H_1$, it is easily proved that their concatenation $H_0\|H_1$, defined by $(H_0\|H_1)(X)=H_0(X)\|H_1(X)$, is at least as resistant as the strongest of $H_0$ and $H_1$ with respect to collision-resistance, <strike>first preimage resistance,</strike> and second-preimage-resistance. Here ...
Is it possible that we take a $PRG$ $G(k)$ of stretch $n\cdot2^n$, and read its output as the table of a $PRF$ $F(K)$ with input and output size of $n$? Intuitively it sounds possible however I read it somewhere that this may not be done.
I'm trying to figure out the best way to generate a cryptographically secure random number between 0 and 200 (inclusive) from a cryptographically secure random string of bytes (ie. read from /dev/urandom or some such). I could do `random[0] % 201` but then numbers 0-54 would be more likely than 55-200 which would ma...
Try to use bitmasks. For example - M is your desired high limit, so use r ?< M/n as a bit mask constructing your number. And after all XOR it with one extra number from RNG.
What are the benefits to not including MAC in a SSH packet encryption? I understand what the MAC is there for, but if it was not included would there be an advantage? Is the MAC somewhat redundant considering the server host key is used during key exchange to authenticate?
MAC in SSH packet encryption, benefits to not including it?
I am struggling to understand how to calculate non-linearty of an s-box, could someone show me a detailed example? I found this [question][1] which helped a little, but I still didn't get it, if someone could show me an example i would apreciate it [1]: https://crypto.stackexchange.com/questions/19968/how-to-ca...
how to calculate nonlinearity?
I know there are many ways to crack basic ciphers were each letter is mapped to some other letter, but what ways are there to decode something that was encrypted using a cipher that changed after every letter, in a way that is based on the letter just coded? For example, imagine using a Caesar cipher where the numbe...
I recently developed a PRNG from scratch with a little inspiration from the initialization function used in the HC stream cipher. The state ($S$) of the basic version is an array of 5 bytes and uses this function in its update procedure: $F(x)=((x <<< 1) \oplus x \oplus (x >>> 1)) \boxplus x$ (three chevrons means rota...
I recently developed a PRNG from scratch with a little inspiration from the initialization function used in the HC stream cipher. The state ($S$) of the basic version is an array of 5 bytes and uses this function in its update procedure: $F(x)=((x \mathbin{<\!\!<\!\!<} 1) \oplus x \oplus (x \mathbin{>\!\!>\!\!>} 1)) \b...
Use RSA instead? eg: generate an RSA keypair, and discard the private key, then encrypt your starting state. If you want to make it faster, manually input the bigmath instructions needed for encryption, unroll them, then manually optimise: you get the added benefit that the result looks just like a "normal" IV, except...
Is it possible to deterministically generate public/private RSA key pairs from passphrases? Would giving the (key generating) algorithm data made from key-stretching the passphrase (instead of a source of random data) be sufficient *and* strong?
Deterministically generate a RSA public/private key pair from a passphrase (with sufficient entropy)?
Have you actually tried coding this thing? It's not a PRNG, it's an *oscillator*. I tried running it with various seed values, and every time it ended up in a loop of about $1000$ iterations. If the initial seed is $(0, 1, 2, 3, 4)$, then [the resulting loop has just $560$ iterations](http://ideone.com/3e4nPH). ...
ECDSA keys are much shorter than RSA keys, but typically only used for signing, not encryption. Is there an accepted way of doing this? (https://bitcointalk.org/index.php?topic=196378.0 deliberately says don't use it.) Note: I'm only looking at encrypting tens of bytes of data, so no AES suggestions please.
Is it possible to deterministically generate public/private RSA key pairs from passphrases? Would giving the (key generating) algorithm data made from key-stretching the passphrase (instead of a source of random data) be sufficient *and* strong? --- Extra credit: Is it possible to generate a key pair from one...
**The MAC is NOT redundant.** As alluded to by Paŭlo Ebermann's comment, the word *authentication* has a different meaning in the two scenarios you mentioned. In the key exchange phase of SSH the purpose of authentication is to ensure both parties that they are indeed talking to the right peer (if using mutual au...
I know there are many ways to crack basic ciphers were each letter is mapped to some other letter, but what ways are there to decode something that was encrypted using a cipher that changed after every letter, in a way that is based on the letter just coded? For example, imagine using a Caesar cipher where the numbe...
I know there are many ways to crack basic ciphers were each letter is mapped to some other letter, but what ways are there to decode something that was encrypted using a cipher that changed after every letter, in a way that is based on the letter just coded? For example, imagine using a Caesar cipher where the numbe...
> Can you help me understand what a cryptographic “salt” is? In the context of password creation, a "salt" is data (random or otherwise) added to a hash function in order to make the hashed output of a password harder to crack. > When might I need to use it? Always. > Why should or should I not use it? Y...
> Can you help me understand what a cryptographic “salt” is? In the context of password creation, a "salt" is data (random or otherwise) added to a hash function in order to make the hashed output of a password harder to crack. > When might I need to use it? Always. > Why should or should I not use it? Y...
A quick question. Are there any problems with the following HMAC use-case: We have two entities ($A$ and $B$), both of them have a secret ($A$ has $S_0$ and $B$ has $S_1$) $A$ generates a random value $r$ and calculates the following tag: $t=HMAC(S_0,r)$ <br> $A$ then sends $(r,t)$ to $B$.<br> $B$ calculates $t...
> Sorry, I might have been unclear. The Caesar cipher was just an example, but say that the positions shift over $f(n)$ letters instead of just $n$, how would $f(n)$ be determined? In general, you may not be able to. For example, consider the following cipher: $$c_i = (p_i + f_K(c_{i-1}, c_{i-2}, \dotsc, c_{i-k...
It's my first venture into cryptography, and I'm struggling with how to use a nonce in an encryption standard between two digital radios. The two radios support AES encryption, only requiring a 128-bit key and a nonce for the encryption/decryption of each packet. To my understanding, the key should be the same for e...
To avoid a timing attack, HMAC signatures are usually compared in constant-time (every byte is compared, and the results aggregated). Is the same necessary for asymmetric signature algorithms such as ECDSA or RSA?
Do asymmetric signatures require constant-time verification?
I'm facing to a project that is build a rainbow table to cracking DES. I've already collected information about Hellman, DP, rainbow table method. Finally, i choose rainbow table. I've read topic [Rainbow table for DES with all-zero plaintext][1] Now, my consideration how to choose good parameter to obtain highest su...
**The MAC is NOT redundant.** As alluded to by Paŭlo Ebermann's comment, the word *authentication* has a different meaning in the two scenarios you mentioned. In the key exchange phase of SSH, the purpose of authentication is to ensure to both parties that they are indeed talking to the right peer (if using mutua...
For SSH why is diffie-hellmangroup1-sha1 used instead of just diffie-hellman? In other words why is the hash function used?
I need a very light encryption scheme which costs almost no performance during encryption (while decryption may be slow). I found 5 algorithms: RC4, DES, LED, PRESENT, and Piccolo. But how do I pick one that's faster than AES on my platform? ![enter image description here][1] [1]: https://i.stack.imgur...
What is the most light-weight symmetric cipher thats still usefull?
I am implementing a bit of security in a system that was originally built without encryption on a specific piece of data. The plan was to encrypt this piece of data and include it as part of the response in a web service. But this data is plainly available in the front end so the user could easily see the plain value a...
How dangerous is it to encrypt with AES 256 if the end user knows the unencrypted value?
So I made my own serial key generation software, using ECDSA, for use in my own applications and it works great so far! To keep the serial key short enough I use a 128 bit EC curve. My final signature (which I use as the product key) ends up containing two BigIntegers, 128-bit each, so the final key ends up being 32 by...
Using ECDSA for software serial key generation, how can this other solution even be possible?
So I made my own serial key generation software, using ECDSA, for use in my own applications and it works great so far! To keep the serial key short enough I use a 128 bit EC curve. My final signature (which I use as the product key) ends up containing two BigIntegers, 128-bit each, so the final key ends up being 32 by...
How can ECDSA signatures be shortened (to be used as a product key)?
I'm looking for an information-theoretic upper bound on leakage by timing measurement. I'm assuming that an attacker - wants to leak out of a black box a secret key of $k$ bits that is secretly injected into the black box; - has written the black box's code (which can read the key and act accordingly), and can craf...
I'm looking for an information-theoretic upper bound on leakage by timing measurement. I'm assuming that an attacker - wants to leak out of a black box a secret key of $k$ bits that is secretly injected into the black box; - has written the black box's code (which can read the key and act accordingly), and can craf...
I'm looking for an information-theoretic upper bound on leakage by timing measurement. I'm assuming that an attacker - wants to leak out of a black box a secret key of $k$ bits that is secretly injected into the black box; - has written the black box's code (which can read the key and act accordingly), and can craf...
I've asked some other questions before about Rijndael's S-boxes, and step by step I'm coming to an understanding; but those steps often guide me to new questions. I did some lines of code to understand how these S-boxes work implementing $S(z) = f(g(z))$ where $g(z)$ is the transformation by multiplicative inverse i...
Is it possible to find the key if we know the plaintext and ciphertext with RC4. How should I write the algorithm?
RC4 , Is it possible to find the key if we know the plaintext and ciphertext ?
RC4 , Is it possible to find the key if we know the plaintext and ciphertext?
I was reading about the Blum Blum Shub random number generator, and it depends on factorization of very large numbers (like most things in crypto). I'm just wondering, if I have 10 computers, can I execute Blum Blum Shub 10 times faster? Or is it impossible to run it in parallel?
Is defactorization hard to solve in parallel?
Almost every encryption algorithm is based on a secret key. I wonder when the algorithm is considered safe, does that also imply that I can prefix (or suffix) the key with a known value, as long as the unique part is of sufficient size? Just disregarding the fact wether would be wise in the first place.
Is it safe to prefix the a key with a known value?
I was reading about the Blum-Blum-Shub random number generator, and its security depends on the hardness of factoring very large numbers (like many things in crypto do). I'm just wondering, if I have 10 computers, can I break Blum-Blum-Shub 10 times faster? Or is it impossible to factor numbers more quickly using pa...
Are factorization algorithms parallelizable?
Generally, the actual key for most cryptographic algorithms is a *fixed length* bitstring (or something more complicated, like a tuple of appropriately chosen large numbers). Thus, if you just take a valid key and add a prefix to it, it will no longer be a valid key at all. (There are a few notable exceptions, such...
I am unable to find a reliable, tested library for a decent password based key derivation function e.g. Scrypt in the programming language I am using, but I have a reliable library for PBKDF2 (which by default uses SHA2-256) and it also allows me to replace the hash function to use Keccak-256 (C=512) instead. Is the...
Suppose we are assigning records an unsigned integer ID from a N-bit space (say 32-bit) in a sequential manner. Is there a way we can code this ID before showing it to the public such that someone can't guess the next ID in the sequence. It should be two-way, such that given the coded int, we can determine the original...
My Math Structures professor mentioned the strange concept of a zero knowledge proof to me after class one day, and I decided to do some reading about it. After reading the relatively famous "How to Explain Zero Knowlege Protocols to Your Children", and the Wikipedia page on zero knowledge proofs, I wanted to see if I ...
Is this an example of a zero knowlege proof?
My Math Structures professor mentioned the strange concept of a zero knowledge proof to me after class one day, and I decided to do some reading about it. After reading the relatively famous "How to Explain Zero Knowlege Protocols to Your Children", and the Wikipedia page on zero knowledge proofs, I wanted to see if I ...
My Math Structures professor mentioned the strange concept of a zero knowledge proof to me after class one day, and I decided to do some reading about it. After reading the relatively famous "How to Explain Zero Knowlege Protocols to Your Children", and the Wikipedia page on zero knowledge proofs, I wanted to see if I ...
From the [Skein 1.3 paper section 4.8, Skein as a Password-Based Key Derivation Function (PBKDF)][1], it mentions the following as a simple PBKDF (*S* = seed and *P* = password): > An even simpler PBKDF is to simply create a very long repetition of *S* and *P*; e.g., *S*||*P*||*S*||*P*||*S*..., and hash that using S...
We are designing an encrypted file system. We plan to use the PCBC (Plaintext Cipher Block Chaining) encryption mode for encryption. This is because we desire the feature ("small changes in the ciphertext would propagate indefinitely when decrypting") in PCBC. However, to our best knowledge, PCBC is not a good choi...
Suppose I want my grandmother to perform encryption without any help from a computer, and she must encrypt the word 'HELLO' for me. I could ask her to instead of typing the real keys, that she always hits the key thats on the right side of the real key. So that instead that she types HELLO, she types JR;;P. On my si...
Which algorithm can be performed by humans?
I find the following IBE scheme from the videos posted and i don't understand the decryption algorithm, will any one please elaborate the 6th step scheme 1. Setup($\lambda$) : $(\mathbb{G}, \mathbb{G}_T, g, P)$ <-- GenBilgroup($\lambda$) $\alpha\leftarrow_R\mathbb{F}_p$ 2. Public Parameters : ...
Small description: consider a polynomial in GF($2^8$) , which has the form $$f(x) = b_7x^7 + b6x^6 + b_{5}x^5 + b_4x^4 + b_3x^3 + b_2x^2 + b_1x + b_0 $$ If we multiply by x , we have $$x * f(x) = (b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x) mod m(x)$$ If b$_7$ = 0, then the res...
TLS_DHE_DSS_AES256_CBC_MAC / TLS_DHE_RSA_AES256_CBC_MAC Hi, I have been studying to learn about various cipher suites and their performances. I gathered that DSS is efficient when compared with RSA. Is it correct and please anyone explain me about their performances and differences?
Difference between the TLS cipher suites?
What does invertibility of the cryptographic primitive mean?
I am reading up on whitebox cryptography and have trouble understanding how are ciphers implemented as one lookup table? assuming my plaintext is just 4 bits so the size of my lookup table should be 2^4? what does this lookup table look like? Specifically, this is the slide I am looking at, I found it on goog...
How do you implement a cipher as one lookup table?
> Is there anything wrong with swapping SHA2 for Keccak for use in PBKDF2? There are 2 main issues. Performance and implementation. <br>**Performance** The performance issue is from an attacker-defender scenario, where the attacker is able to provide FPGA or ASIC resources. In this scenario, Keccak is several ...
Q: How long shall the RSA key be in order to be secure against _practical_ attacks? --- A: **Impractically large**. That's because key length is not the parameter with the most impact on the efficiency of most attacks against RSA, with the exception of factorization of the public modulus. For example, in (Simple) ...
Q: How long shall the RSA key be in order to be secure against _practical_ attacks? --- A: **Impractically large**. This does not imply that RSA is unsafe against practical attacks; only that such attacks must be prevented by ways others than increasing the key size. That's because key size is not a parameter with...
What is the purpose of expanding then shrinking in SHA-1? Does it server any security purposes?
Q: How long shall the RSA key be in order to be secure against _practical_ attacks? --- A: **Impractically large**. This does not imply that RSA is unsafe against practical attacks; only that some such attacks must be prevented by ways others than increasing the key size. That's because key size is not a parameter...
What is the purpose of expanding then shrinking in SHA-1? Does it serves any security purposes?
Q: How long shall the RSA key be in order to be secure against _practical_ attacks? --- A: **Impractically large**. This does not imply that RSA is unsafe against practical attacks; only that some of these attacks must be prevented by ways other than increasing the key size. That's because key size is not a parame...