instruction
stringlengths
15
30k
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*note there is a ref...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*note there is a ref...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*note there is a ref...
$Z=(N-XY)^2$ is a surface with absolute minima ($0s$) anywere $Y=N/X$. I know this question is naiive, but shouldn't it be possible to apply a [lossy compression][1] filter to this function which preserves values only at discrete boundaries and then search for absolute minima? If the answer is no, is there any on...
$Z=(N-XY)^2$ is a surface with absolute minima ($0s$) anywere $Y=N/X$. I know this question is naiive, but shouldn't it be possible to apply a [lossy compression][1] filter to this function which preserves values only at discrete boundaries and then search for absolute minima? If the answer is no, is there any on...
[Bruce Schneier](https://www.schneier.com/blog/archives/2013/09/the_nsa_is_brea.html#c1675929) and [Gregory Maxwell](https://lists.torproject.org/pipermail/tor-talk/2013-September/029956.html) have both stated that they believe the constants chosen for NIST's P curves (i.e. P-256r) are cooked. DJB has put together a [d...
i have some experience with cryptography in the banking sectors, mostly in block ciphers like DES 3DES etc. im interested in prepaid electricity meters as it is a number that is generated from a central system which is disconnected from the meter its self. This would mean they are using a symmetric algorithm using ...
Well, what I concluded from DJB is that the chosen elliptic curves are not as hard as discrete logarithm is + curve 256 lack some security porosities in addition the developer needs to implement extra controls and countermeasures to proof the correctness of the elliptic curve parameters (especially in side channel & fa...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
I know that Huffman is not a encryption method, but I have a bit-stream that I know it's Huffman coded. However, the tree/table that maps the codes to real characters is not available. Surprisingly, during my searches I couldn't find helpful sources or even academic papers on this problem. It seems this problem has no ...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
My problem is the following: we have a low entropy data called ID. (personal id number of 10 decimal digits plus a sum, and it contains a date) We want to create a data (H) which is the same for the same id, but id can neither be computed nor brute-forced by trying all combinations. It should be proven that even we ...
one-way deterministic hash for low entropy input?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Well, what I concluded from DJB is that the chosen elliptic curves are not as hard as discrete logarithm is + curve 256 lack some security porosities in addition the developer needs to implement extra controls and countermeasures to proof the correctness of the elliptic curve parameters (especially in side channel & fa...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
I have client connecting a server over HTTPS to send and retrieve data. * The client always connects through HTTPS * The certificate is known to the client beforehand (hard coded into the software) * The password is auto-generated, so not chosen by the client For authentication, is there any reason I should do ...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
I don't know your exact scenario. However you have two options to encrypt data using *elliptic curve cryptography* (ECC). I'd recommend going with the first option I present. 1. Use **elliptic curve integrated encryption scheme** ([ECIES][1]). ECIES basically performs ElGamal-like encryption on a key. The key is ge...
**S-DES**, or **Simplified DES**, is a "toy" variant of the DES block cipher developed and published by Edward F. Schaefer in 1996 for educational purposes. It has an 8-bit block size and a 10-bit key, and uses two rounds, with two 4x2 bit S-boxes. S-DES is not designed to be a secure block cipher, and indeed it is...
So if I use secp256k1 for example, I've got my key size of 256 bit, and say I sign a SHA256 hash of a message, with size 256 bit, I get an output of size 512bit. Why is there a difference between the hash size and the EC size. In other words, why isn't SHA512 used instead to provide bigger entropy? I'm not too fami...
Logjam: "composite order subgroups" explained for TLS developers and system admins?
Just want to be sure about something before I sign off on a method we're about to put into place. We have a secret, to which a user-defined key is appended. The user can see the SHA256 hash of the secret. The secret and the user-key is then hashed with SHA512 to obtain results. Given the ending hash is SHA512,...
Hash length extension attack - SHA256 to 512 - impossible, correct?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
In most (all?) classical sources such as the book of Goldreich (2001), hard-core predicated are defined thus: > A polynomial-time computable predicate $b : \{0,1\}^* \to \{0,1\}$ is a *hard-core* of a function $f$ if for every probabilistic polynomial-time (PPT) algorithm $A$, every positive polynomial $p$ and all s...
Hard-core predicates: should the adversary be given $1^n$?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
First note that it is not necessary for $B$ to guess the correct $n$. To see this, you can think of the PPT adversary $A'$ that on input $(y, 1^{n-1})$ outputs $A(y, 1^n)$. The sole purpose of the input $1^n$ is to allow $A$ to run in polytime in $n$. However, if the input to $B$ is of size, e.g., a constant $k$, t...
First note that it is not necessary for $B$ to guess the correct $n$. To see this, you can think of the PPT adversary $A'$ that on input $(y, 1^{n-1})$ outputs $A(y, 1^n)$. The sole purpose of the input $1^n$ is to allow $A$ to run in polytime in $n$. However, if the input (i.e., the output of $f$) to $B$ is of siz...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: **First version** (*very flawed*) **...
1. From my little understanding of EC-based authenticated key exchange protocols, I believe that it is not possible for authenticated key exchange without a signing/signature scheme. Is this correct? 2. Consider a scenario where neither client or server have any certificates, and server has the pre-shared secret of...
Authenticated EC key exchange without a signing/signature scheme?
1. From my little understanding of EC-based authenticated key exchange protocols, I believe that it is not possible for authenticated key exchange without a signing/signature scheme. Is this correct? 2. Consider a scenario where neither client nor server have any certificates, and server has the pre-shared secret o...
In Al-Gamal Algorithm, the public key is *(p, g, A)*, and the secret key is *(a)*, in order to encrypt some data, the sender generate a random *k*, where: (*C1*, *C2*) = (*m.A^k (mod p)*, *g^k (mod p)*) If a hacker know the value of *k*, should this break the algorithm security ?
In El-Gamal Algorithm, the public key is *(p, g, A)*, and the secret key is *(a)*, in order to encrypt some data, the sender generate a random *k*, where: (*C1*, *C2*) = (*m.A^k (mod p)*, *g^k (mod p)*) If a hacker know the value of *k*, should this break the algorithm security ?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
In El-Gamal Algorithm, the public key is $(p, g, A)$, and the secret key is $(a)$, in order to encrypt some data, the sender generate a random $k$, where: $(C_1, C_2) = (m.A^{k} \pmod{p}, g^{k} \pmod{p})$ If a hacker know the value of $k$, should this break the algorithm security ?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
Consider a number $r$ obtained by: $r=a \cdot b \mod n$ Knowning the factorization of $r$ can reveal some information (bits) of $a$ and $b$ ?
Factorization of a number obtained by a modular multiplication operation can reveal factors of the used operands?
I have only the barest understanding of cryptography, but I've been following the Logjam issue; some posts and articles (elsewhere) imply that a PC user can regenerate DH keys. Is Logjam solely a server issue? Is there a way for the PC user to perform DH regeneration on a regular basis; if so, how? Is there any way the...
Can the PC user perform any DH regeneration?
I have only the barest understanding of cryptography, but I've been following the Logjam issue; some posts and articles (elsewhere) imply that a client can regenerate DH keys. Is Logjam solely a server issue? Is there a way for the client to perform DH regeneration on a regular basis; if so, how? Is there any way the c...
Can a TLS client perform any DH regeneration?
I think we're all aware of the Logjam attack. From now on we know that re-using primes for DH is a bad idea. But we also say that elliptic curves are safe from the attack (relying on the NFS), because it cannot be applied. I understand this. Now in my mind this question arose: **Assuming we had enough compu...
Logjam on Elliptic Curves?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
Is it possible to have key pairs for two different ciphers — for example RSA 1024 and some yet to be released EC or other asymmetric cipher than uses 1024 bit keys — that have the same public key? And is there any research on this that I can read?
Is it possible to have identical public keys for different ciphers?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
Is it possible (and is there any research I can read) to have 2 key pairs for different ciphers, for example RSA 1024 and some yet to be released EC (or other asymmetric cipher) than uses 1024 bit keys, that have the same public key?
Let P be a secure block cipher, eg AES-128. Let's say a server has a CBC encryption oracle which uses an attacker-selected yet unique nonce to generate the IV for each message = P(key, nonce). The same key is used to generate the IV from the nonce as to encrypt the message. This system is not semantically secure ...
from reading [the TLS 1.1 RFC][1], it looks like it would be possible to break a previously recorded TLS <1.2, 512-bit DHE ServerKeyExchange and then send it (unmodified, with the original, valid signature) to a client that still accepts TLS <1.2 and 512-bit DHE to impersonate a server that has since been fixed (disabl...
possible MITM attack against servers that used to support weak DH?
1.<br> It is "possible for authenticated key exchange without signing/signature scheme". <br> Any means of authenticating messages can replace the signature scheme. 2.<br> If the "pre-shared secret" is a key, then the technique is using [MAC](https://en.wikipedia.org/wiki/Message_authentication_code)s to authent...
I collect entropy from the following sources: - system_entropy = System provided crypto entropy stream (CryptGenRandom on Windows) - user_entropy = User-provided entropy - in a form of a byte stream of serialized random mouse movements, key strokes etc (this is manually entered by the user, similar to how TrueCrypt...
from reading [the TLS 1.1 RFC][1], it looks like it would be possible to break a previously recorded TLS <1.2, 512-bit DHE ServerKeyExchange and then send it (unmodified, with the original, valid signature) to a client that still accepts TLS <1.2 and 512-bit DHE to impersonate a server that has since been fixed (disabl...
Consider a number $r$ obtained by: $r=a \cdot b \mod n$ Can knowing the factorization of $r$ reveal some information (bits) of $a$ and $b$ ?
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
I have a huge list of MD5 hashes, which takes up quite some space. I was wondering if I would acheive (some) compression, by encoding the characters (which are A-F 0-9), with [huffman coding][1]. I made a quick script, and seem to notice that almost every character in the strings (A-F 0-9), has the same frequency in th...
Alice encrypts her data with HER secret key. Then she sends the encrypted data to Bob who should encrypt it with HIS secret key. Caroline should then eventually get this double encrypted data. Caroline only wants to receives pseudo-random (looking) data which would only be decryptable for her if Alice and Bob BOTH ...
from reading [the TLS 1.1 RFC][1], it looks like it would be possible to break a previously recorded TLS <1.2, 512-bit DHE ServerKeyExchange and then send it (unmodified, with the original, valid signature) to a client that still accepts TLS <1.2 and 512-bit DHE to impersonate a server that has since been fixed (disabl...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
Say I’m using a 128 bit block cipher and would like to encrypt a 256 bit input that would be divided to two blocks, however I wish that every bit changed in the ciphertext would completely corrupt both plaintext blocks when decrypted. Consider the following simple solution: --- **Version 1 - two blocks only** ...
I've read [this paper][1] about the encrypt-mix-encrypt mode for ciphers and was asking myself if this mode provides "full" diffusion. So if an attacker alters one bit of the ciphertext, how many bits (all?) get scrambled on decryption? (if using AES and blocks of size 4096 bits (drive sector size)) Or in other w...
from reading [the TLS 1.1 RFC][1], it looks like it would be possible to break a previously recorded TLS <1.2, 512-bit DHE ServerKeyExchange and then send it (unmodified, with the original, valid signature) to a client that still accepts TLS <1.2 and 512-bit DHE to impersonate a server that has since been fixed (disabl...
From what I could research, XORing a random key adds [confusion](http://www.cs.sjsu.edu/~stamp/CS265/SecurityEngineering/chapter5_SE/conAndDiff.html). But I do not undertand the rationale for that classification. Shannon's confusion is supposed to obscure the relationship between the ciphertext and key, but the OTP ...
Does the One Time Pad relay on confusion or diffusion?
Boxcryptor uses various `CSPRNGs` and apparently [hashes the output using `PBKDF2` to derive the final key](https://boxcryptor.desk.com/customer/portal/articles/624000-how-strong-is-the-encryption-key-). Even though the choice of `PBKDF2` is probably not semantically correct (`PBKDF2` is intended for passwords), I wond...
Does the One Time Pad rely on confusion or diffusion?
I am a bit of a newbie to RSA encryption, so please be patient. I understand that for a 4096 bit RSA, the numbers p and q should be prime. And to have the best security, the p and q should both be about 2048 bits long. However, we don't have a way of generating and verifying a 2048 bit prime number with 100% accu...
I want a code 'black box' that receives data inputs, processes those inputs, then sends out the outputs. I want the code to be encrypted, or somehow obfuscated. Is there any known way to do achieve this outcome?
Executing ecnrypted code?
Executing encrypted code?
If one obtains the plaintext and the corresponding ciphertext in OTP, then the key is determined. But the key is used only for one message, otherwise it will be two-time pad attack, and the next key is random. So it does not reveal any information about other plaintexts. Suppose $M=C=K=\{0,1\}^2$ and we are given t...
All the articles I read on the web about DSA keep telling me that the size of the hash needs to be truncated so that the bit length is equal to or lesser than the bit length of the prime number of the field. For example, [Wikipedia says](https://en.wikipedia.org/wiki/Digital_Signature_Algorithm): > * Choose an ap...
Why do we truncate the hash when using DSA?
Encrypt-then-Authenticate (EtA) seems to generally be considered the better option, compared to Authenticate-then-Encrypt (AtE) (see this [Crypto.SE][1] question, for example). The people writing the RFC for TLS 1.2 [seem to have been aware of this][2], but have chosen to use AtE anyway. Is there a reason why this i...
Why does TLS do Authenticate-then-Encrypt instead of Encrypt-then-Authenticate?
if you do encrypt first you have to have pre-shared secret keys between client and servers? once master secret is generated then Record protocol job is to encrypt/decrypt.