instruction
stringlengths
15
30k
As far as I understood, a secret key (same length as CBC block size) and an initialization vector (IV) are needed to decrypt a AES-256-CBC encrypted string. As the IV should better be random, it has be distributed in plaintext along with the encrypted text. Is there a standard or at least "commonly used" format to f...
As far as I understood, a secret key (same length as CBC block size) and an initialization vector (IV) are needed to decrypt a AES-256-CBC encrypted string. As the IV should better be random, it has be distributed in plaintext along with the encrypted text. Is there a standard or at least "commonly used" format to f...
> Is there a standard or at least "commonly used" format to format the result? [PKCS #7][1] describes a standard format for encrypted data. While it's mainly meant for public key encrypted data, it also has options for symmetric keys. It's rather complex due to all the features it supports, however, so unless you ca...
I've found a way to complete a task which I'd solve with passwords or by sending keys over the wire (otherwise) by using RSA's homomorphic property. I'm restricted to RSA (any padding; for hardware reasons) to implement "blindable decryption", where one party holds some encrypted data, blinds it, sends it to the dec...
Suppose Alice shares a secret block cipher key , KAB with Bob, and a different secret block cipher key , KAC with Charlie. Describe a method for Alice to encrypt an mblock message such that it can only be decrypted with the cooperation of both Bob and Charlie. The ciphertext should only be a constant size greater than...
When [discussing][1] the CTR mode of block ciphers, Wikipedia says the following: > Simply adding or XORing the nonce and counter into a single value > would completely break the security under a chosen-plaintext attack. I don't understand the difference between the split nonce/counter design and simply using a ...
Why is it good to split a CTR-mode counter into nonce and counter?
according to wikipedia: RSA-617 has 617 decimal digits (2,048 bits). RSA-2048 has 617 decimal digits (2,048 bits). What is the main difference between them?
I'm designing a program which makes queries to a database stored locally which could potentially contain a lot of sensitive information. As such the information must be kept secure as possible from any possible attack. I plan on doing this by encrypting the data by AES-256 in CBC mode. The encryption / decryption key w...
Using SHA-1 algorithm for hashing ephemeral ECDH public key is not recommended as below? https://blog.mozilla.org/security/2014/09/23/phasing-out-certificates-with-sha-1-based-signature-algorithms/ http://googleonlinesecurity.blogspot.jp/2014/09/gradually-sunsetting-sha-1.html My server sends following Serve...
When [discussing][1] the CTR mode of block ciphers, Wikipedia says the following: > Simply adding or XORing the nonce and counter into a single value > would completely break the security under a chosen-plaintext attack. I don't understand the difference between the split nonce/counter design and simply using a ...
> I don't understand the difference between the split nonce/counter design and simply using a random value and incrementing. Why is using nonce +/⊕ counter insecure whereas nonce || counter is secure? Here's the context of your Wikipedia quote (my bold): > If the IV/nonce is random, then they can be combined toge...
Using SHA-1 algorithm for hashing ephemeral ECDH public key is not recommended as below? * [Phasing Out Certificates with SHA-1 based Signature Algorithms][1] * [Gradually sunsetting SHA-1][2] My server sends following Server Key Exchange message for TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b). TLSv1...
Is SHA-1 safe in ECDHE?
> I don't understand the difference between the split nonce/counter design and simply using a random value and incrementing. Why is using nonce +/⊕ counter insecure whereas nonce || counter is secure? Here's the context of your Wikipedia quote (my bold): > If the IV/nonce is random, then they can be combined toge...
It is conjectured that SHA-1 has been broken from the "research" perspective but no in real world. That is that there is an algebraic attack that explores weaknesses on its algebraic construction. The same happens for MD5 but MD5 has been practically broken by finding collisions in real world. Can we still use HMAC wit...
Is SHA-1 still practically secure under specific scenarios?
I have a NoSQL key-value database. I want to insert couple million of records to it. For the key generation, I'm, using a prefix (something like `data-one-`) and then concat the SHA256 hash of something unique to the value stored. So the end key might look like `data-one-0000fdb60e164cf0bf07cef647354d26ed17c9492ca4...
Suppose Alice shares a secret block cipher key, $K_{AB}$ with Bob, and a different secret block cipher key, $K_{AC}$ with Charlie. Describe a method for Alice to encrypt an m block message such that it can only be decrypted with the cooperation of both Bob and Charlie. The ciphertext should only be a constant size grea...
Suppose that $s_1$ and $s_2$ are two stings that have a small hamming distance. Is there a hash function ($H$) that can map them to the same value i.e., $H(s_1) = H(s_2)$?
How to hash similar strings to the same hash value?
Is using the SHA-1 algorithm insecure for hashing the ephemeral ECDH public key in the `signed_params` structure? There are some worrying articles about using SHA-1: * [Phasing Out Certificates with SHA-1 based Signature Algorithms][1] * [Gradually sunsetting SHA-1][2] My server sends the following Server Key...
Is SHA-1 safe for signing ECDHE parameters?
I recentely faced the issue of random access decryption while AES-GCM was being used. I said this person that the underlying CTR should allow parallelization but I have no idea how authentication comes into play. Now I know that one of the cool features of CTR is that you can decrypt any block without needing to inv...
Is (AES-)GCM parallelizable?
Craig Gentry's 2010 paper on FHE is very cool, and I'm planning on implementing a basic proof of concept FHE. I was wondering though, are there any simpler methods that have been discovered since then? The bootstrapping and the multiplication pre shared table would be nice to get rid of if possible. (I'm sure the wh...
Are there simpler FHE methods than Craig Gentry's original paper?
I was thinking about FPE specifically for numbers, CC, phone, SS #, etc. and I thought of some small "optimization" that could be implemented. Can I validate the string length after each round in the Feistel network, and repeating a round with the same tweak if the data is invalid, and continue until a set # of tweaks/...
I have a NoSQL key-value database. I want to insert couple million of records to it. For the key generation, I'm, using a prefix (something like `data-one-`) and then concat the SHA256 hash of something unique to the value stored. So the end key might look like data-one-0000fdb60e164cf0bf07cef647354d26ed17c...
Chopping off SHA256 entropy?
Suppose Alice shares a secret block cipher key, $K_{AB}$ with Bob, and a different secret block cipher key, $K_{AC}$ with Charlie. Describe a method for Alice to encrypt an m block message such that it can only be decrypted with the cooperation of both Bob and Charlie. The ciphertext should only be a constant size grea...
Actually the article you link to does not say that a balanced Feistel cipher is less secure than an unbalanced one; it says that the security of an unbalanced Feistel cipher is more easily proven, _given enough rounds_. Luby and Rackoff have [shown in 1988][1] that a balanced Feistel scheme with only 4 rounds is "pe...
As [fgrieu already pointed out](http://crypto.stackexchange.com/questions/12589/does-the-key-schedule-function-need-to-be-a-one-way-function?rq=1#comment26906_12589), using a OWF in the way you describe would make the key schedule not efficiently invertible (or even not invertible at all), meaning you would need more m...
The creation of the prekeys for Serpent works by XORing some previous values with a counter and a fixed value. Every word is 32 bits big and 4 words form a round key (after applying a S-Box, but this shall not be part of this question). The original raw key of 256 bit is $w_{-8}$ to $w_{-1}$, $\phi$ is a constant te...
> Is there a standard or at least "commonly used" format to format the result? [PKCS #7][1] (and [CMS][2] which is a further development) describes a standard format for encrypted data. While it's mainly meant for public key encrypted data, it also has options for symmetric keys. It's rather complex due to all the f...
I'm designing a program which makes queries to a database stored locally which could potentially contain a lot of sensitive information. As such the information must be kept secure as possible from any possible attack. I plan on doing this by encrypting the data by AES-256 in CBC mode. The encryption / decryption key w...
Suppose that $s_1$ and $s_2$ are two stings that have a small hamming distance. Is there a preimage resistant "hash" function ($H$) that can map them to the same value i.e., $H(s_1) = H(s_2)$?
HOTP, the HMAC-based One-Time Password algorithm from [RFC 4226][1], uses a "dynamic truncation" function to turn the 20 byte HMAC-SHA-1 value into a 31 bit string. The dynamic truncation (from Section 5.3) works like this (and [is probably useless][2]): DT(String) // String = String[0]...String[19] Let O...
How does the HOTP dynamic truncation function generalize to longer hashes?
I’m a bit confused about what the simulator of the special-honest verifier zero-knowledge property of a $\Sigma$-protocol is supposed/allowed to do and how to prove that it is indeed efficient (i.e. it runs in a time polynomial in the security parameter). A 3-move protocol between a prover $P$ and a verifier $V$ is ...
RE: 'But for a split moment, the server knows the secret' ... and so is the wireless bug in the cable of the keyboard, the web-cam of your laptop and iPhone, the microwave microphone of the satellite eavesdropping the sound of your keystrokes, etc. If you are afraid of the server don't go in Internet (it is not the se...
I've read that lattice based algorithms involve matrix-vector products. Is this the case of the NTRU algorithm? When I've read the details of the NTRU algorithm, I've seen products of polynoms. Where are the matrix-vector products?
What kind of operations are involved in NTRU?
If I have to chose a 64 bit preimage resistant hash function; will there be any difference in security between - [SipHash][1] and - [SHA512/64][2] (SHA512 truncated to 64 bits)? How long will it take an attacker to find a 64 bit preimage (e.g., minutes, weeks or years)? [1]: https://en.wikipedia.org/wiki...
Same 64bit preimage resistance security for SipHash and SHA512/64?
Craig Gentry's 2010 paper on FHE is very cool, and I'm planning on implementing a basic proof of concept FHE. I was wondering though, are there any simpler methods that have been discovered since then? The bootstrapping and the multiplication pre shared table would be nice to get rid of if possible. (I'm sure th...
If I have to chose a 64 bit preimage resistant hash function; will there be any difference in security between - [SipHash][1] and - [SHA-512/64][2] (SHA-512 truncated to 64 bits)? How long will it take an attacker to find a 64 bit preimage (e.g., minutes, weeks or years)? [1]: https://en.wikipedia.org/wi...
Same 64-bit preimage resistance security for SipHash and SHA-512/64?
SipHash [doesn't][1] claim to be a secure hash function. Only a secure MAC. So if you try to use it as a hash function, with a constant, public key, you are on your own. SHA-512/64 should be a "secure" 64-bit hash, which is of course not enough for a truly secure hash, since it only has 32-bit collision resistance. ...
I apologize ***profusely*** for knowing nothing about cryptography, please go easy on me! I'm working on a project where I have a 2048-bit RSA private key and a public certificate generated from the private key. I encrypt secrets at one end-point using the certificate and decrypt them at another end-point using the ...
How badly does disclosing an M-bit prefix of an N-bit private key compromise security?
SipHash [doesn't][1] claim to be a secure hash function. Only a secure MAC. So if you try to use it as a hash function, with a constant, public key, you are on your own. SHA-512/64 should be a "secure" 64-bit hash, which is of course not enough for a truly secure hash, since it only has 32-bit collision resistance. ...
I apologize ***profusely*** for knowing nothing about cryptography, please go easy on me! I'm working on a project where I have a 2048-bit RSA private key and a public certificate generated from the private key. I encrypt secrets at one end-point using the certificate and decrypt them at another end-point using the ...
NIST key management guidelines suggest that 15360-bit RSA keys are equivalent in strength to 256-bit symmetric keys. If a 15360-bit RSA key is the equivalent to a 256-bit symmetric key, does that mean a 15360-bit RSA key can prevent factoring by the strongest quantum computers in the next 100 years or so? So a 256-...
What does "a 15360-bit RSA key is the equivalent to a 256-bit symmetric key" mean?
NIST key management guidelines suggest that 15360-bit RSA keys are equivalent in strength to 256-bit symmetric keys. If a 15360-bit RSA key is the equivalent to a 256-bit symmetric key, does that mean a 15360-bit RSA key can prevent factoring by the strongest quantum computers in the next 100 years or so? If not, how ...
Imagine I *only* have the hash of a file which we can call **hash(file)**. Then a user sends me a data block (or section) of the same file, which we can call **section1(file)**. Is there a way to prove that such section belongs to the file, given only the hash of it? I was thinking of constructing a Merkle tree. So ...
Given just the hash of a file, can I prove that the file contains a specific data block?
> But for a split moment, the server knows the secret ... and so is the wireless bug in the cable of the keyboard, the web-cam of your laptop and iPhone, the microwave microphone of the satellite eavesdropping the sound of your keystrokes, etc. If you are afraid of the server don't go in Internet (it is not the serv...
NIST key management guidelines suggest that 15360-bit RSA keys are equivalent in strength to 256-bit symmetric keys. If a 15360-bit RSA key is the equivalent to a 256-bit symmetric key, does that mean a 15360-bit RSA key can prevent factoring by the strongest quantum computers in the next 100 years or so? If not, how ...
People say "hash and salt", but aren't you supposed to salt password the password first, and then hash it? So that means its called
Hash and salt or salt and hash?
People say "hash and salt", but aren't you supposed to salt password the first, and then hash it? So that means its called "salt and hash" right?
I don't think this would break correctness, but it's possible you might actually slow your algorithm down on average. You'd need a more rigorous combinatorial analysis of the expected number of repeated rounds vs. the expected number of full cycle walks. That really depends on the specific algorithm; are you using FFX?...
Assuming your deck is completely random and that it is not retrivable, how hard would it be for a casual person to decrypt the message? What about law enforcement? Thanks.
How hard is the Solitaire cipher to crack?
Assuming your deck is completely random and that it is not retrivable, how hard would it be for a casual person to decrypt a message encrypted with [the Solitaire cipher][1]? What about law enforcement? Thanks. [1]: https://www.schneier.com/solitaire.html
Imagine I *only* have the hash of a file which we can call `hash(file)`. Then a user sends me a data block (or section) of the same file, which we can call `section1(file)`. Is there a way to verify that such section belongs to the file, given only the hash of it? I was thinking of constructing a Merkle tree. So the...
Given just the hash of a file, can I verify that the file contains a specific data block?
I further assume you mean a DER-encoded *unencrypted* PKCS#8 RSA key, since you wouldn't care about exposing an encrypted key, and it's a conventional two-prime key with equal-size factors (each 1024 bits) and the ubiquitous e=65537 using the standard PKCS#1 CRT-form representation. I also note that 21 bits is a rea...
Can a digital cash scheme exist that is anonymous and offline using blind signature and anonymous signature?
How can you encrypt n messages with the same key, and have the same theoretical security you'd have encrypting a single message with a one time pad? For example, how can you encrypt 2 messages with the same key, and have that same theoretical security? I think for n=2, something like E(M) = (K<sub>1</sub>M + K<sub>0</...
How can you encrypt n messages with the same key, and have the same theoretical security you'd have encrypting a single message with a one time pad? For example, how can you encrypt 2 messages with the same key, and have that same theoretical security? I think for $n=2$, something like $E(M) = (K_1M + K_0) mod (p-1)...
I've seen the ECB Penguin used to demonstrate why ECB is not a recommended method of encryption, but I do not understand how this translates to text or passwords. [![ECB Penguin image][1]][1] Aren't the people who create these images comparing apples and oranges? [1]: https://i.stack.imgur.com/AWg5i.jpg
It illustrates the point that the same plaintext going in to the cipher will result in the same ciphertext. It just happens to be a lot better example than showing someone abc387af de7231ab abc387af abc387af a129867e Now, what does this mean in the real world? If I gave you an email encrypted with AES-128 EC...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
Assuming your deck is completely random and that it is not retrivable, how hard would it be for a casual person to decrypt a message encrypted with [the Solitaire cipher][1]? [1]: https://www.schneier.com/solitaire.html
How can you encrypt $n$ messages with the same key, and have the same theoretical security you'd have encrypting a single message with a one time pad? For example, how can you encrypt two messages with the same key, and have that same theoretical security? I think for $n=2$, something like $E(M) = (K_1M + K_0) \mod ...
I know that AES in combination with CBC mode is vulnerable against the [Padding Oracle Attack][1]. RSA also uses some kind of padding, hence can this attack be apply to RSA encrypted messages too? [1]: https://en.wikipedia.org/wiki/Padding_oracle_attack
Is RSA vulnerable to the padding oracle attack?
I assume the United Kingdom will impose (as opposed to just talk about it) restrictions on crypto software that may be used within it's borders. Me, quite the border clown (*yes, I always bring a up to nine (only because I can't fit ten times 100ml plus containers into a 1000ml bag) re-sealable, see-through containe...
Mathematically / statistically "safe" way to differentiate between crypto and random blob?
How can you encrypt $n$ messages with the same key, and have the same theoretical security you'd have encrypting a single message with a one time pad? For example, how can you encrypt two messages with the same key, and have that same theoretical security? I think for $n=2$, something like $E(M) = (K_1M + K_0) \mod ...
I need to encrypt messages using PublicKeyCrypto and send it to the server, where the message should be decrypted. I'm aware of the [Padding Oracle Attack][1] and want to apply a server side integrity check of the incomming cipher messages. In AES there is the so called `CCM` mode, which performs the integrity checks i...
How to verify the integrity of RSA encrypted messages?
I need to encrypt messages using PublicKeyCrypto and send it to the server, where the message should be decrypted. I'm aware of the [Padding Oracle Attack][1] and want to apply a server side integrity check of the incomming cipher messages. In AES there is the so called `CCM` mode, which performs the integrity checks i...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
I have done some research on PGP and I found out there are of two reasons why we must generate the signature before doing any compression. Yet, I am not sure I really understand them both. One reason states that the message must be compressed first and signed later because if we need to do any future validation, we...
Why must we generate the signature before any compression being done at PGP?
I am very new to PGP. PGP encryption works with hash function, asymmetric encryption, symmetric encryption and a zip algorithm (LZ77). What I know is that the zip algorithm is used to reduce the length of message which has repeating characters, but the algorithm consist of two encoding schemes which are: -- <0> ...
Details related to the ZIP algorithm used in PGP message encryption?
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
I need to encrypt messages using PublicKeyCrypto and send it to the server, where the message should be decrypted. I'm aware of the [Padding Oracle Attack][1] and want to apply a server side integrity check of the incoming cipher messages. In AES there is the so called `CCM` mode, which performs the integrity checks im...
From [BSI-TR-03111][1] (PDF), on page 15: > The class number of the principal order belonging to the endomorphism ring of E SHOULD be at least 200. This value commonly is referred to as $h$ in that publication. I‘ve got two questions related to this: 1. What does $h$ mean/denote? 2. Why should it be 200 or...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
I assume the United Kingdom will impose (as opposed to just talk about it) restrictions on crypto software that may be used within it's borders. Me, quite the border clown (*yes, I always bring a up to nine (only because I can't fit ten times 100ml plus containers into a 1000ml bag) re-sealable, see-through containe...
As for the first reason: in the future you probably need the decompressed form of the message. There won't be much you can *do* with the compressed message. But PGP is *application level*; you may want to verify that message at any time. Now you may want to verify the signature over that decompressed data without compr...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...