instruction stringlengths 15 30k |
|---|
I wonder if ChaCha20 alone is sufficient for securing files stored on a disk or should Poly1305 should be used along with it? AFAIK, Poly1305 is used to secure the authentication channel, but for securing data-at-rest, the key can be read from the OS's keystore, which (typically) is fairly secure - correct?
If so, d... |
Is ChaCha20 alone sufficient for securing data-at-rest? |
The IND-CPA game has two challenge-response phases
1. A key is generated by running $Gen(1^n)$ and challenger selects a bit
b {0,1} uniformly at random.
2. Adversary gets input $1^n$.
3. Can query the oracle a polynomial number of times with messages and gets $E_k(m)$ back.
4. Attacker sends messages $m_0$... |
The first publication of an MD5 collision was on 17-Aug-2004 17:44 UTC on the eprint archive server: Xiaoyun Wang, Dengguo Feng, Xuejia Lai and Hongbo Yu, [_Collisions for Hash Functions MD4, MD5, HAVAL-128 and RIPEMD_][1] ([third version][2]). The results where fresh: the authors had just corrected IV endianness, that... |
You **really don't want to use ChaCha20 alone** in [(nearly)][1] *any* situation.
What ChaCha20 does for you is to prevent attackers from (passively) reading your data, which is good. But ChaCha is a so-called *stream cipher* which works by XOR'ing a pseudorandom pad with the message (your file at rest). However it ... |
For the byte substitution layer in AES how do we determine B(i)? I follow how to use the multiplicative inverse table and using that to get B`(i), but how do I actually calculate the affine mapping? Is this normal matrix multiplication?
[![enter image description here][1]][1]
[1]: https://i.stack.im... |
AES S-Box Affine Mapping - how to do it? |
Suppose I have a private matrix $A$ that I want to conceal. I do the matrix multiplication $A^\prime =AK$ and $A^\prime$ is public.
How can I quantitatively measure "how well" the matrix $A$ is concealed? To be specific, I may select different matrices $K$ and want to analyze the different protection levels provid... |
Quantitatively measure the private information revealed by a matrix? |
*Mathematically* speaking, there is no such thing as a collision-free hash. *Practically* speaking, there is.
Cryptographic hash functions in good standing have no known collisions. That's one of their defining properties. They do have collisions, but there isn't enough computing power on Earth (if not in the whole ... |
I recently came across a [library](http://www.outsystems.com/forums/discussion/10565/documentation/) that promises to do deterministic encryption with the following scheme:
> AES with 256 bit key in CBC mode with PKCS7 padding and Synthetic Initialization vector taken from the first 16 bytes of the HMACSHA256 mac of t... |
I'm working on a product with strong security. Essentially there is an App, downloaded from the iTunes App Store. When the App starts up, it generates a strong RSA keypair and stores it in the Keychain. This key pair is the foundation for a lot of things in the overall system. The next step is for the App to use this k... |
I'm working on a product with strong security. Essentially there is an App, downloaded from the iTunes App Store. When the App starts up, it generates a strong RSA keypair and stores it in the Keychain. This key pair is the foundation for a lot of things in the overall system. The next step is for the App to use this k... |
> My question is how do I authenticate my App to the CA, to prevent something else to request these Client Certificates?
There is generally no way to authenticate the client code. Any secret you embed in the app could be extracted. You must assume an attacker can send requests that an authentic client would.
Inst... |
The question asks for a signature scheme, with a public verification procedure, that is tolerant to minor alterations of the signed data during its transmission [possibly in analog form over some noisy channel], where the signature is a _small_ digital appendix sent over a digital channel assumed error-free in the abse... |
From Wikipedia(https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29#Proofs_of_correctness):
$m^{ed}$ ≡ m (mod q) <br>
$m^{ed}$ ≡ m (mod p)<br>
then $m^{ed}$ = m (mod pq)
**Question:**<br>
if $m^{ed}$ ≡ m (mod q),then q|$m^{ed}$- m <br>
if $m^{ed}$ ≡ m (mod p),then p|$m^{ed}$- m <br>
that is to say, $m^{ed}$... |
The title is pretty descriptive of my question. As an example, say I use the MD5 hash function to create a hash key of the word "hello": 5d41402abc4b2a76b9719d911017c592.
There are two questions I would like to have answered:
1. How difficult would it be to calculate **any** new string that would hash to the same... |
If I know the hash function that produced a hash key, how easily can I generate an input to hash to the same key? |
I note that libsodium provides AEAD when using symmetric cryptography: http://doc.libsodium.org/secret-key_cryptography/aead.html
And yet, under section 8 (Public-key cryptography) there are no public-key methods described which allow for additional data (AD) to be included.
Keeping in mind cryptographic best pra... |
How do I tack on "additional data" to libsodium's public-key authenticated encryption? |
From Wikipedia(https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29#Proofs_of_correctness):
$m^{ed}$ ≡ $m$ $\pmod{q}$<br>
$m^{ed}$ ≡ $m$ $\pmod{p}$<br>
then $m^{ed}$ ≡ $m$ $\pmod{pq}$
**Question:**<br>
if $m^{ed}$ ≡ $m$ $\pmod{q}$,then $q$|$m^{ed}$- $m$ <br>
if $m^{ed}$ ≡ $m$ $\pmod{p}$,then $p$|$m^{ed}$- $m... |
I note that libsodium [provides AEAD][1] when using symmetric cryptography.
And yet, under section 8 (Public-key cryptography) there are no public-key methods described which allow for additional data (AD) to be included.
Keeping in mind cryptographic best practices, is there an elegant way to essentially add the... |
After having read the [RFC 3610: *Counter with CBC-MAC (CCM)*][1] and [the Wikipedia article on CTR mode][2], I'm not sure how a nonce should be picked. The RFC says:
> 2. A nonce N of 15-L octets. Within the scope of any encryption key
K, the nonce value MUST be unique. That is, the set of nonce
... |
From Wikipedia(https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29#Proofs_of_correctness):
$m^{ed}$ ≡ $m$ $\pmod{q}$<br>
$m^{ed}$ ≡ $m$ $\pmod{p}$<br>
then $m^{ed}$ ≡ $m$ $\pmod{pq}$
**Question:**<br>
if $m^{ed}$ ≡ $m$ $\pmod{q}$,then $q$|$m^{ed}$- $m$ <br>
if $m^{ed}$ ≡ $m$ $\pmod{p}$,then $p$|$m^{ed}$- $m... |
I am using http://dnaq.github.io/sodiumoxide/sodiumoxide/crypto/box_/curve25519xsalsa20poly1305/fn.seal.html from `sodiumoxide` crate written in Rust language which is a wrapper over `libsodium` c library and that function calls `crypto_box_curve25519xsalsa20poly1305` in `libsodium` library. How much is it a security c... |
There is a similarly worded question here but it doesn't answer mine.
I am trying to make an enigma simulator. I have finished doing everything except the ring settings. How do they affect the substitutions?
For example suppose the initial rotor settings are:
abcdefghijklmnopqrstuvwxyz
ekmflgdqvzntowy... |
How does the ring settings of enigma change wiring tables? |
From Wikipedia(https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29#Proofs_of_correctness):
$m^{ed}$ ≡ $m$ $\pmod{q}$<br>
$m^{ed}$ ≡ $m$ $\pmod{p}$<br>
then $m^{ed}$ ≡ $m$ $\pmod{pq}$
**Question:**<br>
if $m^{ed}$ ≡ $m$ $\pmod{q}$,then $q$|$m^{ed}$- $m$ <br>
if $m^{ed}$ ≡ $m$ $\pmod{p}$,then $p$|$m^{ed}$- $m... |
I am using [curve25519xsalsa20poly1305/fn.seal](http://dnaq.github.io/sodiumoxide/sodiumoxide/crypto/box_/curve25519xsalsa20poly1305/fn.seal.html) from `sodiumoxide` crate written in Rust language which is a wrapper over `libsodium` c library and that function calls `crypto_box_curve25519xsalsa20poly1305` in `libsodium... |
I'm working on my miner for [my "game" site][1] that's basically a pre-image attack from a hash posted online. You submit a hash input, it's hashed, and your score is the hamming distance (the number of bits that differ) between the two values. If it matters, I'm using Skein-1024 v1.3
My miner up until now has been ... |
Would it matter if my miner was hashing random vs incremental values? |
Are there any algorithms/protocols that let you produce a specific length of random tokens/bits in such a way that you can cryptographically determine which 2 or more tokens/bitstrings where produced using the same seed/key. Is it possible at all? any pointers will be greatly appreciated
For example, if I produce th... |
Are there any algorithms/protocols that let you produce a specific length of random tokens/bits in such a way that you can cryptographically determine which 2 or more tokens/bitstrings where produced using the same seed/key. Is it possible at all?
For example, if I produce these random bits: `12432`, `15693`, with ... |
It is no *security leak* to use the sender's public and private key with that function rather than the receiver's public and the sender's private key.
The reason for this is that **you're the only person who can decipher the message afterwards**.
To understand this you need to understand how the keys are used.
... |
I want to generate a small 30 or 32 bit PRP. I am going to use that prp in an open web service and anyone will be able to get any number of plaintext-cyphertext pairs.
I've found an algorithm called FastPRP https://eprint.iacr.org/2012/254.pdf and the problem statement fits my requirements perfectly. However the per... |
If you need a 32 bit PRP, might I suggest the [Speck][1] cipher? It isn't greatly secure (with a 32 bit block size, the only option is a 64 bit key, which isn't great), however it's *extremely* fast.
[1]: https://en.wikipedia.org/wiki/Speck_(cipher) |
If the digital signature in ECC (ECDSA) is made using a private key, why is the OpenSSL library using ECKEY pair as an input parameter instead of the private key only ? |
Why a key pair is used in OpenSSL ECDSA_sign or ECDSA_do_sign instead of only private key ? |
How much can I shorten a password hash before it begins to impact security?
Suppose that I use PBKDF2 (correctly salted) with HMAC-SHA256 as the PRF. From what I've seen, it's typical to use 256 bits of output, since that matches what comes out of the PRF.
My intuition suggests that there would be no security im... |
Are shorter password hashes safe? |
My apologies, I'm quite new to cryptography.
If we relax the definition of perfect secrecy such that
for cyphertext c, messages m0 and m1, and constant E:
P[c|m0] <= E * P[c|m1]
Using this, Can I prove a lower bound on the size of the key space as a function of the size of the message space?
I don't... |
I am building an iOS app that allows the user to sign a document served to them by a web server. So that page of the app simply has a document in the top pane, and at the bottom pane, a place to sign with your finger.
So, I want to use DSA to allow this app to sign that doc and have the non-repudiation property. But... |
How does DSA provide non-repudiation in proving a document was properly displayed (not altered or displayed incorrectly)? |
I want to generate a small 30 or 32 bit PRP. I am going to use that PRP in an open web service and anyone will be able to get any number of plaintext-cyphertext pairs.
I've found an algorithm called [FastPRP][1] and the problem statement fits my requirements perfectly. However the performance seems quite low for 30-... |
I am building an iOS app that allows the user to sign a document served to them by a web server. So that page of the app simply has a document in the top pane, and at the bottom pane, a place to sign with your finger.
So, I want to use DSA to allow this app to sign that doc and have the non-repudiation property. But... |
My apologies, I'm quite new to cryptography.
If we relax the definition of perfect secrecy such that
for cyphertext $c$, messages $m_0$ and $m_1$, and constant $E$:
$P[c|m_0] \le E * P[c|m_1]$
Using this, Can I prove a lower bound on the size of the key space as a function of the size of the message spa... |
> My intuition suggests that there would be no security impact if this output were truncated to 128 bits. Is this correct? My reasoning here is that salting prevents multi-target attacks, and that collisions are unimportant in the context of password verification.
Correct, there is no practical security impact. The ... |
I want to de/encrypt several binary files rather frequently on a normally battery-powered device. My goal is to use AES-256 when the device is AC-powered and a highly performant algorithm when it's battery-powered to save power. I appreciate that the level of security will be compromised.
Is there a performant algo... |
I am very new to Crypto and need some clarification or input. The question is:
**Suppose that Alice wants to encrypt a message for Bob, where the message consists of three plaintext blocks, Po, P1, and P2- Alice and Bob have access to a hash function and a shared symmetric key K, but no cipher is available. How can... |
First, there is no way that crypto can keep an attacker from manipulating the data that is shown to the user. to prevent this, you have to trust some part of your hardware, at least the screen that views the data and some chip inside that can do some crypto.
Moreover, digital signatures alone will not solve this pr... |
Are there any algorithms/protocols that let you produce a specific length of random tokens/bits in such a way that you can cryptographically determine which 2 or more tokens/bitstrings where produced using the same seed/key. Is it possible at all?
For example, if I produce these random bits: `12432`, `15693`, with ... |
> My intuition suggests that there would be no security impact if this output were truncated to 128 bits. Is this correct? My reasoning here is that salting prevents multi-target attacks, and that collisions are unimportant in the context of password verification.
Correct, there is no practical security impact. The ... |
I see that KDFs should be used in systems that rely on PSKs, but what practical benefit does it provide?
For instance, suppose the system relies on a shared secret for AES encryption and decryption. If the en/decryption uses a key derived from a KDF, an attacker could still sniff the key and decrypt the file. Yes, ... |
Practical benefit of using a KDF? |
I'm a bit confused after reading several articles that seem to provide conflicting information. Basically I was wondering if AES by itself can be used as an FPE? And if so is this something computationally prohibitive, or something reasonable to do. Furthermore how can we use AES by itself + cycle walking?
Accor... |
How can AES + cycle walking be used as an FPE? |
Given input string **S**, and transformation (i.e. computer program) **T**, is it possible to provide a succinct proof that another binary string **S'** is identical to the output **T(S)**?
By "succinct", I basically mean significantly less computationally intensive than repeating the original transformation. Also,... |
Is succinct verification of an arbitrary data transformation theoretically possible? Is it feasible? How? |
Elliptic curve point addition and point doubling operations using Projective and Jacobian coordinates require fewer field multiplication operations when considering Z coordinates of input points equal to one (Z1=Z2=1). Is there any drawback of this strategy? |
I am very new to Crypto and need some clarification or input. The question is:
> Suppose that Alice wants to encrypt a message for Bob, where the message consists of three plaintext blocks, $P_0$, $P_1$, and $P_2$ - Alice and Bob have access to a hash function and a shared symmetric key $K$, but no cipher is availa... |
**I very well understand the DH key exchange. But what is the public key and private key at the end of the exchange.**
For Example. cons. this wiki analogy.
Alice and Bob agree to use a modulus p = 23 and base g = 5 (which is a primitive root modulo 23).
Alice chooses a secret integer a = 6, then sends Bob A... |
How is a Public key/Private key pair derived/generated from Diffe Hellman key exchange? |
I very well understand the DH key exchange. But what is the public key and private key at the end of the exchange.
For example:
Alice and Bob agree to use a modulus $p = 23$ and base $g = 5$ (which is a primitive root modulo $23$).
Alice chooses a secret integer $a = 6$, then sends Bob $A = g^a \bmod p
= 5^6 \b... |
How is a public/private key pair generated from a Diffe-Hellman key exchange? |
> So is 2 the private key here ?
No, it's referred to as a "shared secret" (because it is shared between Alice and Bob, and is secret to everyone else).
If there were 'private' and 'public' keys (which is not the standard terminology with DH), then Alice's private key would be $a=6$, and the public key would be $... |
There seems to be a distinct lack of implementations of RSA signatures using OAEP to pad the digest. Other than the old, funky, padding schemes, it's PSS all the way.
PSS seems to have the whiff of patents about it. OAEP, on the other hand, is accompanied by long diversions about its theoretical safety presented as ... |
Why not use OAEP for signatures? |
One good reason not to use [RSAES-OAEP][1] for signature is because _as it stands_, it can't do signature! RSAES-OAEP performs _encryption_ of a message (of limited length) with optional label into a cryptogram, and decryption thereof. There is no way to turn some RSAES-OAEP black box into a signing machine.
---
OK... |
One good reason not to use [RSAES-OAEP][1] for signature is because _as it stands_, it can't do signature! RSAES-OAEP performs _encryption_ of a message (of limited length) with optional label into a cryptogram, and decryption thereof. There is no way to turn some RSAES-OAEP black box into a signing machine.
---
OK... |
I'm currently try to understand all differences between homomorphic encryption and garbeled circuits. As I understood does the use of homomorphic encryption hides either the data and the computation from the computational party but what's about the circuits? The the algorithm is implemented in the circuit it's only hid... |
> So is $2$ the private key here ? If it's a private key then both Alice and Bob know it even though the eavesdroppers don't know. Please explain how public key/private key pair is generated from this shared secret $2$.
As the others said, $2$ is a shared secret, rather than a private key.
It is usually used to [... |
Why q-ary lattices are used to most cryptosystems rather than lattices.
In most of the papers q-ary lattices are used. Is there any advantage? |
Elliptic curve point addition and point doubling operations using Projective and Jacobian coordinates require fewer field multiplication operations when considering $Z$ coordinates of input points equal to one ($Z_1=Z_2=1$). Is there any drawback of this strategy? |
Why q-ary lattices are used to most cryptosystems rather than lattices.
In most of the papers q-ary lattices are used. Is there any advantage?
and
Given $$B=(v_1,v_2,v_3,.....v_n)$$ is the basis, lattice generated by B
$$ L(B)=\{a_1v_1 + ........ + a_nv_n|a_1........,a_n ∈ Z\}$$
Fix q and g... |
Lets say , if we encrypt a plain text message $msg$ with key $key$ in below two ways. Which is the below would give better deterministic encryption and why ?
1. AES-ECB($key$ , $msg$)
2. SIV($key$, NIL , $msg$) where associated data is NIL.
I could not make out much from Rogaway and Shrimpton's paper on "[Dete... |
[Kerchoff's principle][1] is named after a publication over 130 years old. Yet it is still something that is commonly misunderstood and challenged by newcomers to cryptography. [This question from Open Source Stack Exchange seems typical][2], and one answer to it implies that at some point, cryptographers in general "g... |
When did Kerchoff's principle become fully accepted in design and practice of modern ciphers? |
[Kerchoff's principle][1] is named after a publication over 130 years old. Yet it is still something that is commonly misunderstood and challenged by newcomers to cryptography. [This question from Open Source Stack Exchange seems typical][2], and one answer to it implies that at some point, cryptographers in general "g... |
[Kerckhoffs's principle][1] is named after a publication over 130 years old. Yet it is still something that is commonly misunderstood and challenged by newcomers to cryptography. [This question from Open Source Stack Exchange seems typical][2], and one answer to it implies that at some point, cryptographers in general ... |
When did Kerckhoffs's principle become fully accepted in design and practice of modern ciphers? |
I'm currently trying to understand the differences between homomorphic encryption and garbled circuits. Homomorphic encryption enables one to either hide the data or the computation(i.e. circuit privacy) from the computational party. Is this the same for Garbled Circuits too ? Does Garbled Circuit hide only data ? |
I'm currently trying to understand the differences between homomorphic encryption and garbled circuits. Homomorphic encryption enables one to either hide the data or the computation(i.e. secure function evaluation) from the computational party. Is this the same for Garbled Circuits too ? Does Garbled Circuit hide only ... |
Suppose two agents `A` and `B` share a common secret and `A` makes a regular unique 16-byte announcement to `B` every 10mins which `B` must verify authenticity.
I'm thinking of letting the first 8 bytes be the message and the last 8 bytes be the HMAC(key, msg). The message itself contains an increasing counter, whic... |
I am trying to find a collision with the Bobcat hash of the 48-bit hash.
I am a beginner coder so please point out any flaws in my modification of the bobcat program. It does find a truncated 12-bit collision of the first 12 bits. Now it has been running for 2 days trying to find a 48-bit collision with no avail.
... |
I am trying to find a collision with the Bobcat hash of the 48-bit hash.
I am a beginner coder so please point out any flaws in my modification of the bobcat program. It does find a truncated 12-bit collision of the first 12 bits. Now it has been running for 2 days trying to find a 48-bit collision with no avail.
... |
I'm currently try to understand all differences between homomorphic encryption and garbeled circuits. As I understood does the use of homomorphic encryption hides either the data and the computation from the computational party but what's about the circuits? The the algorithm is implemented in the circuit it's only hid... |
I'm currently trying to understand all the differences between homomorphic encryption and garbeled circuits. As I understood does the use of homomorphic encryption hides either the data or the computation from the computational party but what about the circuit? Is only the data hidden with homomorphic encryption? |
I'm currently trying to understand all the differences between homomorphic encryption and garbeled circuits. As I understood the use of homomorphic encryption hides either the data or the computation from the computational party, but what about the circuit? Is only the data hidden with homomorphic encryption? |
Why q-ary lattices are used to most cryptosystems rather than lattices.
In most of the papers q-ary lattices are used. Is there any advantage?
and
Given $$B=(v_1,v_2,v_3,.....v_n)$$ is the basis, lattice generated by B
$$ L(B)=\{a_1v_1 + ........ + a_nv_n\ |\ a_1........,a_n ∈ Z\}$$
Fix q a... |
Why q-ary lattices are used to most cryptosystems rather than lattices.
In most of the papers q-ary lattices are used. Is there any advantage?
and
Given $$B=(v_1,v_2,v_3,.....v_n)$$ is the basis, lattice generated by B
$$ L(B)=\{a_1v_1 + ........ + a_nv_n\ |\ a_1........,a_n ∈ Z\}$$
Fix q a... |
[Kerckhoffs's principle][1] is named after a publication over 130 years old. Yet it is still something that is commonly misunderstood and challenged by newcomers to cryptography. [This question from Open Source Stack Exchange seems typical][2], and one answer to it implies that at some point, cryptographers in general ... |
I need to implement the Fujisaki-Okamoto commitment scheme for a project such that I can demonstrate performance of various zero-knowledge proofs in relation to one another, for example Boudot's "[proof that a committed number belongs to an interval][1]" (see §3.1 if you are interested in what this entails, though it i... |
I need to implement the Fujisaki-Okamoto commitment scheme for a project such that I can demonstrate performance of various zero-knowledge proofs in relation to one another, for example Boudot's "[proof that a committed number belongs to an interval][1]" (see §3.1 if you are interested in what this entails, though it i... |
I am using 32 byte EC private keys on the client side of a web application. These keys should be securely stored on a server database. The keys should be encrypted (AES) before being sent to the server in javascript. The ciphertext will be given to the client when they have been authenticated with their login credentia... |
Is there any reasonable ASN.1 standard to encode symmetric keys?
I found PKSC, but it seems extremely heavy, and I can't quite find any library (e.g. bouncycastle) that would simplify using it.
If all I need is to encode a symmetric key, would it be sufficient to just include:
- algorithm ID
- block size
... |
Are there any existing ASN.1 structures for transferring symmetric keys? |
Is there any reasonable ASN.1 standard to encode symmetric keys?
I found [PSKC][1], but it seems extremely heavy, and I can't quite find any library (e.g. bouncycastle) that would simplify using it.
If all I need is to encode a symmetric key, would it be sufficient to just include:
- algorithm ID
- block si... |
Its tested against many of the test-vectors (key varying, plaintext varying, Monte Carlo), which is the only contract it needs to fulfil... I've some speed/timing information now:
128 bit, key setup 0.37ms
128 bit, ECB, encryption 0.58ms / block (27.5kB/s)
128 bit, ECB, decryption 0.77ms / block (20.5kB/s)
1... |
1. If you encrypt the private say with a 8-char password, the strength of your solution will be not 32 bytes (256 bits), but merely 8 bytes (32 bits). The comment of "user4982" above is correct. Doing your encryption process more complicated does NOT make it more secure. The strength depends only on the length of the s... |
It’s tested against many of the test-vectors (key varying, plaintext varying, Monte Carlo), which is the only contract it needs to fulfil... I've got some speed/timing information now:
128 bit, key setup 0.37ms
128 bit, ECB, encryption 0.58ms / block (27.5kB/s)
128 bit, ECB, decryption 0.77ms / bloc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.