instruction
stringlengths
15
30k
These questions revolve around `DH and ECDH` vs `DHE and ECDHE`. Specifically within the context of TLS/SSL. There are three questions in total (and a fourth bonus question). The goal of using Diffie-hellman at all in TLS/SSL is to avoid the case where the contents of the certificate are the sole source for seed v...
How is the curve equation used in ECC?
Let's say there is a shared storage: USB flash drive, external HDD, or whatever you like. I'll refer to it as disk. Also, there are multiple parties, let's say Alice and Bob (may be thousands of them) who periodically access that disk exclusively. So, for instance, one day Alice takes disk from the table, reads and wri...
To my understanding in a 1-n Oblivious Transfer the Sender has some Values $X_1...X_N$ and the receiver wants to retreave some $X_I$, with $1 \le I \le N$. Can one now somehow guarantee, that the Receiver has the permissions to retreive said $I$? Assuming every receiver has some rights to receive exactly one certain...
Define a commutative block cipher with keyspace the finite set $K$, and data space the finite set $S$, to be an application $$\begin{align} E:K\times S&\mapsto S\\ (k,x)&\mapsto E(k,x)\text{ also noted }E_k(x)\\ \text{such that }&\forall k\in K,\forall x\in S, \forall y\in S,\text{ if }E(k,x)=E(k,y)\text{ then }x=y...
Can a commutative block cipher be indistinguishable from a random permutation, for fixed key?
Define a commutative block cipher with keyspace the finite set $K$, and data space the finite set $S$, to be an application $$\begin{align} E:K\times S&\mapsto S\\ (k,x)&\mapsto E(k,x)\text{ also noted }E_k(x)\\ \text{such that }&\forall k\in K,\forall x\in S, \forall y\in S,\text{ if }E(k,x)=E(k,y)\text{ then }x=y...
Seems like the answer is that your goal is obviously impossible, without Bob's cooperation. How would Alice distinguish between (1) a write to the disk by Bob's PC, initiated at Bob's request, vs (2) a write to the disk by Bob's PC, initiated by the malware? She can't. They look identical from Alice's perspective. ...
I'm delivering shared secret with DH exchange, using a static key for signing and an ephemeral for session, so is there a point using GCM for encrypting the data, or a simple CBC/CTR block cipher is enough like this? Also, I'm not sure what's the point authenticating the encrypted data, since if it gets modified, it w...
Is there a point using GCM block chiper with Authenticated DH?
Unless you are absolutely sure that you don't need to and that the cost is going to be significant then I would absolutely say you should use authenticated encryption. One reason is bit-flipping attacks - flipping a few bits at the 'right' point in your encrypted message might lead well to a message that *is* legal (t...
I'm delivering shared secret with DH exchange, using a static key for signing and an ephemeral for session, so is there a point using GCM for encrypting the data, or is a simple CBC/CTR block cipher is enough? Also, I'm not sure what's the point authenticating the encrypted data, since if it gets modified, it will p...
I'm trying to figure out how to demonstrate DH key exchange using what is given to me. I'm unsure of how to tackle the problem. ---------- **Question:** Demonstrate Diffie-Hellman key exchange. Given p=104933, A=324, B=5832. Prime factors for p-1 {2,37,709} A and B are Alice and Bob secret keys respecti...
Define a commutative block cipher with keyspace the finite set $K$, and message space the finite set $S$, to be an application $$\begin{align} E:K\times S&\mapsto S\\ (k,x)&\mapsto E(k,x)\text{ also noted }E_k(x)\\ \text{such that }&\forall k\in K,\forall x\in S, \forall y\in S,\text{ if }E(k,x)=E(k,y)\text{ then }...
Can a commutative block cipher be indistinguishable from a random such one?
Define a commutative block cipher with keyspace the finite set $K$, and data space the finite set $S$, to be an application $$\begin{align} E:K\times S&\mapsto S\\ (k,x)&\mapsto E(k,x)\text{ also noted }E_k(x)\\ \text{such that }&\forall k\in K,\forall x\in S, \forall y\in S,\text{ if }E(k,x)=E(k,y)\text{ then }x=y...
Can a commutative block cipher be indistinguishable from a random one, assuming a random permutation of keyspace?
Define a commutative block cipher with keyspace the finite set $K$, and message space the finite set $S$, to be an application $$\begin{align} E:K\times S&\mapsto S\\ (k,x)&\mapsto E(k,x)\text{ also noted }E_k(x)\\ \text{such that }&\forall k\in K,\forall x\in S, \forall y\in S,\text{ if }E(k,x)=E(k,y)\text{ then }...
Define a commutative block cipher with keyspace the finite set $K$, and message space the finite set $S$, to be an application $$\begin{align} E:K\times S&\mapsto S\\ (k,x)&\mapsto E(k,x)\text{ also noted }E_k(x)\\ \text{such that }&\forall k\in K,\forall x\in S, \forall y\in S,\text{ if }E(k,x)=E(k,y)\text{ then }...
Define a commutative block cipher with keyspace the finite set $K$, and message space the finite set $S$, to be an application $$\begin{align} E:K\times S&\mapsto S\\ (k,x)&\mapsto E(k,x)\text{ also noted }E_k(x)\\ \text{such that }&\forall k\in K,\forall x\in S, \forall y\in S,\text{ if }E(k,x)=E(k,y)\text{ then }...
There are various different [modes of operation](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation) for block cipher use, some of which provide "encryption" and some of which provide [authenticated encryption](http://en.wikipedia.org/wiki/Authenticated_encryption). **Why should I use an [authenticated encr...
I was just wondering if I add more security by combining two or more symmetric encryptions on a plain text. For example: `Plaintext → AES → Twofish → Serpent` Of course a different key and IV (produced with a cryptographic secure prng) is used for each algorithm. Speed fortunately is not important. Or does th...
Hello I want to decrypt a file in aes 128 cbc mode with openssl i got the .key file which is 32 digits but when i try to decrypt with openssl ask me for -vi and i dunno the vi of that file so it won't decrypt it if theres any other way to decrypt it without knowing the VI? I tried with other file that have the correspo...
I want to decrypt a file that has been encrypted using AES-128 in CBC mode using OpenSSL. I got the “.key” file – which is 32 digits – but when I try to decrypt with OpenSSL, the program asks me for “-iv” and I don't know the IV of that file so it won't decrypt. Is there is any other way to decrypt the file without kno...
Decrypt AES-128 with key file but missing IV?
I am trying to implement a proposed improved algorithm of RSA . Here the author has increased the number of exponents. However i am unable to understand what 'h' is in the Key generation step. Can someone tell me what h is exactly? The author's paper is : http://iosrjournals.org/iosr-jece/papers/Vol9-Issue1/Version...
What is h in the improved solution of RSA algorithm?
I am trying to implement a proposed improved algorithm of RSA . Here the author has increased the number of exponents. However I am unable to understand what $h$ is in the Key generation step. Can someone tell me what $h$ is exactly? The author's paper is : http://iosrjournals.org/iosr-jece/papers/Vol9-Issue1/Versi...
The authors of the paper might be able to tell you; I suspect no one else will. You are having problems understanding the paper; a large part of the reason is that the paper isn't very well written; it introduces terminology (such as the "ph" without defining what "ph" is), and includes things that don't make any se...
The authors of the paper might be able to tell you; I suspect no one else will. You are having problems understanding the paper; a large part of the reason is that the paper isn't very well written; it introduces terminology (such as "ph") without ever defining it, and includes things that don't make any sense, such...
I was reading about Schnorr's scheme and in that for signing the signer generates a random <br> number and continues with his operation. I am trying to implement this in a scenario where <br> the signature length is small and the number of possible messages is also very small. Is generating a random number and ...
Does changing the random number selected for each message increase security in Schnorr's scheme?
How do I create a short signature? (e.g. less than 100 bytes)
I am interested in comparing the computational performance of two signature schemes. However, I am unsure how to do that. My candidates are RSA and Shamir's ID Based Signature scheme. To get a fair comparison, I want both schemes to be parametrized in a way ensuring a "comparable level of security". However, the questi...
How to compare different signature scheme's performance?
I would like to supply a token to clients who login to a system that will authenticate future requests. To ensure the token is not tampered with, I want to create a signature for the token that I can verify. I realize security it a spectrum, but I want to know if there are any obvious problems with the following scheme...
I would like to supply a token to clients who login to a system that will authenticate future requests. To ensure the token is not tampered with, I want to create a signature for the token that I can verify. I realize security it a spectrum, but I want to know if there are any obvious problems with the following scheme...
I would like to supply a token to clients who login to a system that will authenticate future requests. To ensure the token is not tampered with, I want to create a signature for the token that I can verify. I realize security it a spectrum, but I want to know if there are any obvious problems with the following scheme...
I would like to supply a token to clients who login to a system, which will be used to authenticate future requests. To ensure the token is not tampered with, I want to create a signature for the token that I can verify. I realize security it a spectrum, but I want to know if there are any obvious problems with the fol...
In Section 6.3 of the [RFC for TLS 1.2](http://www.faqs.org/rfcs/rfc5246.html), it is written that the key_block is derived from the following formula: key_block = PRF(SecurityParameters.master_secret, "key expansion", SecurityParameters.server_random + ...
I am creating software tokens for future request authentication, and I want to use an HMAC for the token to make them tamper-resistant. To ensure I can check the HMAC later I need a secret, persistent key. Is there a security concern in using a private RSA key as the HMAC key? If not, what would the best values be from...
I am creating software tokens for future request authentication, and I want to use an HMAC for the token to make them tamper-resistant. To ensure I can check the HMAC later I need a secret, persistent key. Is there a security concern in using a private RSA key as the HMAC key? If not, what would the best values be from...
If you truly can't be dissuaded from 'using' an RSA key for HMAC, be sure to derive a strong symmetric key using HKDF with a salt and some associated data. I have a suggestion for you based on your comment to Stephen's answer. If all you need to do is store the symmetric key in the key/cert store, why not encode so...
What is the difference between Pseudo Random Functions and Random Oracles? 1. Is the difference only about the domain of PRFs and Random Oracles, former having a fixed domain and latter can act on any input as long as it is well formatted? 2. Having a Random Oracle is a stronger assumption, why is that?
What is the difference between PRF and a Random Oracle?
TAHOE-LAFS uses a form of "key-dependent encryption", in that a private key `SK` is encrypted with the truncated hash of the private key: ENC(Htrunc(SK), SK) Where `Htrunc(X)` is the result of `SHA256(SHA256(X))`, truncated to 16 bytes. The TAHOE-LAFS paper states: > This somewhat unusual arrangement me...
TAHOE-LAFS uses a form of "key-dependent encryption", in that a private key `SK` is encrypted with the truncated hash of the private key: ENC(Htrunc(SK), SK) Where `Htrunc(X)` is the result of `SHA256(SHA256(X))`, truncated to 16 bytes. The [TAHOE-LAFS paper](https://eprint.iacr.org/2012/524.pdf#page=4) st...
While reading Shamir, Rivest and Adleman's paper on "Mental Poker", I've met a mention of system such that $E_a(E_b(x)) = E_b(E_a(x))$, without however disclosing details on it, with $E_a(x)$ being “encrypt plaintext $x$ with key $a$”. Do any existing secure modern cryptosystems have this property, and how is it cal...
The usual recommendation is ECDSA, or if you need a really short signature, BLS. See *[“Security.SE: What asymetric scheme provides the shortest signature, while being secure?”](http://security.stackexchange.com/q/33044/971)*, *[“Security.SE: How to encrypt a short string to a short ciphertext using an asymmetric encr...
How can I prove the following: > If $f$ is a one-way function, then it is an uninvertible function?
TLS Key Block calculation - What is a PRF?
Plenty of ciphers come out of the USA from government research or selection competitions. AES and DES are examples. Are there any public ciphers produced by other states, China or Iran for example? Do you really think they trust AES? **EDIT: List of ciphers from different nations:** - Japan: [Camellia][3] -...
I am trying to implement a proposed improved algorithm of RSA . Here the author has increased the number of exponents. However I am unable to understand what $h$ is in the Key generation step. Can someone tell me what $h$ is exactly? The author's paper is : http://www.jacn.net/papers/47-N024.pdf I had originally p...
One issue that private BitTorrent trackers that track users' share ratios often run into is how to keep track of people who are screwing with their upload statistics, something known as "stat-hacking". As it is, because uploading and downloading is entirely peer-to-peer, there is no reliable way for the tracker to know...
Is it possible to create a "proof-of-upload" system for BitTorrent ratio tracking?
I'm going through Smart and Vercauteren's paper "Fully Homomorphic SIMD operations" and had a question about some notation used in the paper. In section 2 of the above it is stated that for $F(X) \in \mathbb{F}_2[X]$ is monic polynomial of degree $N$ that splits into $r$ distinct irreducible factors of degree $d = N/r$...
I'm reading through [Chow et al.'s paper](http://crypto.stanford.edu/DRM2002/whitebox.pdf) and [Link et al.'s paper](http://eprint.iacr.org/2004/025.pdf). There's a part I don't understand about Delinearization. They convert some steps of AES/DES into a Matrix, then divide the matrix in 8x4 matrices and use look ...
I'm going through Smart and Vercauteren's paper "Fully Homomorphic SIMD operations" and had a question about some notation used in the paper. In section 2 of the above it is stated that for each monic polynomial $F(X) \in \mathbb{F}_2[X]$ of degree $N$ that splits into $r$ distinct irreducible factors of degree $d = N/...
I'm reading through [Chow et al.'s paper](http://crypto.stanford.edu/DRM2002/whitebox.pdf) and [Link et al.'s paper](http://eprint.iacr.org/2004/025.pdf). There's a part I don't understand about Delinearization. They convert some steps of AES/DES into a Matrix, then divide the matrix in 8x4 matrices and use look ...
If you truly can't be dissuaded from 'using' an RSA key for HMAC, be sure to derive a strong symmetric key using HKDF with a salt and some associated data. I have a suggestion for you based on your comment to Stephen's answer. If all you need to do is store the symmetric key in the key/cert store, why not encode so...
One issue that private BitTorrent trackers that track users' share ratios often run into is how to keep track of people who are screwing with their upload statistics, something known as "stat-hacking". As it is, because uploading and downloading is entirely peer-to-peer, there is no reliable way for the tracker to know...
One issue that private BitTorrent trackers that track users' share ratios often run into is how to keep track of people who are screwing with their upload statistics, something known as "stat-hacking". As it is, because uploading and downloading is entirely peer-to-peer, there is no reliable way for the tracker to know...
I have three questions: 1. Would you use HMAC-SHA1 or HMAC-SHA256 for message authentication? 2. How much HMAC-SHA256 is slower than HMAC-SHA1? 3. Are the security improvements of SHA256 (over SHA1) enough to justify its usage?
> Would you use HMAC-SHA1 or HMAC-SHA256 for message authentication? Yes. That is a semi-serious answer; both are very good choices, assuming, of course, that a Message Authentication Code is the appropriate solution (that is, both sides share a secret key), and you don't need extreme speed. > How much HMAC-SH...
When browsing websites with Chrome sometimes I can see a green lock and encryption info inside. It says the connection with this website is 128-bit or 256-bit encrypted with TLS1.2. So I'm wondering that is that possible to use 512-bit or higher encryption on websites?
Is that possible to use encryption higher than 256-bit?
Almost a decade ago Raymond Chen blogged [1] about the "hash reset attack" cautioning developers to record the content length in addition to the message digest. Recently I came up with a variation on the MD5 hashing algorithm that incorporates the file size. I've called this algorithm 'MDS' for 'Message Digest +...
What are alternatives to number theory based crypto?
> So I'm wondering that is that possible to use 512-bit or higher encryption on websites? Not with the current TLS standard (v1.2), the strongest algorithm it appears to support is only Camellia or AES with 256 bit key lengths. The strength and type of the cipher actually used for a connection depends on the server'...
In the [the main post][2] about MAC methods it mentions a few methods: - **Authenticate And Encrypt**: The sender computes a MAC of the plaintext, encrypts the plaintext, and then appends the MAC to the ciphertext. - **Authenticate Then Encrypt**: The sender computes a MAC of the plaintext, then encrypts both t...
For a one-time pad, which MAC method is information-theoretically secure?
Can i use Shamir's secret sharing scheme for multiplicative homomorphism for secure multiparty computation?
I would like to perform a dot product operation among $m$ parties using Shamir's $(t,m)$ secret sharing that is used for Secure Multiparty Computation. I am aware that Shamir's $(t,m)$ scheme is additively homomorphic, but can someone please provide an example of how I can use it for multiplicative homomorphism for...
Can I use Shamir's secret sharing scheme for multiplicative homomorphism for secure multiparty computation?
In the [the main post][2] about MAC methods it mentions a few methods: - **Authenticate And Encrypt**: The sender computes a MAC of the plaintext, encrypts the plaintext, and then appends the MAC to the ciphertext. - **Authenticate Then Encrypt**: The sender computes a MAC of the plaintext, then encrypts both t...
There was a recent article about a [new encryption technique][1] that encrypts "using the time variations between two independent coupling functions". What is this technique they are referring to? [1]: http://gizmodo.com/new-unbreakable-encryption-is-inspired-by-your-inside-1558124990
Is it a kind of same? Authenticate means it is from sender. Also sign is done by the sender. Can someone please give a clear view about their relationship?
What is the difference between authenticate a document and sign a document?
I'm encrypting data with AES, using [CryptoJS](https://code.google.com/p/crypto-js/). CryptoJS returns an empty string in case the data couldn't be encrypted with the given passphrase. I'm not sure if this is intended, or happens in all libraries, but I need to know whether or not the data was decrypted successfully...
Prefixing data before encryption for passphrase confirmation?
I'm going through Smart and Vercauteren's paper "Fully Homomorphic SIMD operations" and had a question about some notation used in the paper. In section 2 of the above it is stated that for each monic polynomial $F(X) \in \mathbb{F}_2[X]$ of degree $N$ that splits into $r$ distinct irreducible factors of degree $d = N/...
I have implemented HKDF by myself and it seems to work good. I managed to replicate all the test vectors listed [here][2] but... except this one: Test with SHA-256 and longer inputs/outputs Hash = SHA-256 IKM = 0x000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e...
The Wikipedia article [Trusted Timestamping][1] states that we can timestamp data by publishing it's hash. Publishing can be done either independently or via a third-party publisher, as explained by DrLector on [another thread][2]. However, can we timestamp data without the capability to publish anything? What so...
Is timestamping possible without publishing?
The Wikipedia article [Trusted Timestamping][1] states that we can timestamp data by publishing it's hash. Publishing can be done either independently or via a third-party publisher, as explained by DrLector on [another thread][2]. However, can we timestamp data without the capability to publish anything? What so...
We do compression in PGP. Does this step increase/decrease or either has any effect in the authentication of a message?
1.) Proving the security of a scheme with [the random oracle model](https://en.wikipedia.org/wiki/Random_oracle) (ROM) involves two steps: first you prove that the scheme is secure in an idealized world where a random oracle exists, and then you implement this scheme in the real world by replacing the random oracle wit...
I am designing a system that uses TLS-like handshaking on a resource-constrained embedded system. I have settled on AES-CCM mode for symmetric session encryption and authentication, allowing encryption and MAC to use the same key. I would further like to combine the server write and client write keys into a single ke...
1. Proving the security of a scheme with [the random oracle model](https://en.wikipedia.org/wiki/Random_oracle) (ROM) involves two steps: first you prove that the scheme is secure in an idealized world where a random oracle exists, and then you implement this scheme in the real world by replacing the random oracle with...
I having trouble verifying an ECDSA signature signed using client side javascript with Java/BouncyCastle. The javascript signing function [source][1]: sign: function (hash, priv) { var d = priv; var n = ecparams.getN(); var e = BigInteger.fromByteArrayUnsigned(hash); do { var k = ECDSA.get...
This is a trivial question, but I had to ask: since each generated share in a Shamir's secret sharing scheme initially consists of a pair of values (representing the coordinates of a point on the plane), how do I reduce the two values to one, so that the share that I eventually hand out will consist of only one valu...
In Professor Boneh's online Cryptography course at Coursera I am a little puzzled by his definition of a statistical test where he writes: A(x) = iff |#0(x) - #1(x)| <= 10.√n Now, if, as an example, we were to perform this test on a string of 100 bits, then 10 multiplied by the square root of 100 is...100. But i...
In Professor Boneh's online Cryptography course at Coursera, I am a little puzzled by his definition of a statistical test where he writes: > A(x) = iff |#0(x) - #1(x)| <= 10.√n Now, if – as an example – we were to perform this test on a string of $100$ bits, then $10$ multiplied by the square root of $100$ is… ...
I'm going through Smart and Vercauteren's paper "Fully Homomorphic SIMD operations" and had a question about some notation used in the paper. In section 2 of the above it is stated that for each monic polynomial $F(X) \in \mathbb{F}_2[X]$ of degree $N$ that splits into $r$ distinct irreducible factors of degree $d ...
I am interested in comparing the computational performance of two signature schemes. However, I am unsure how to do that. My candidates are RSA and Shamir's ID Based Signature scheme. To get a fair comparison, I want both schemes to be parametrized in a way ensuring a "comparable level of security". However, the questi...
I would like to perform a dot product operation among $m$ parties using Shamir's $(m,m)$ secret sharing that is used for Secure Multiparty Computation. I am aware that Shamir's $(m,m)$ scheme is additively homomorphic, but can someone please provide an example of how I can use it for multiplicative homomorphism for...
I am not creating my own cryptography or anything, but to learn about the Dos and Donts of cryptography, I am looking into AES encryption and ways to generate keys for that. As far as I've understood, one of the options to create cryptographically secure keys would be to gather entropy from /dev/urandom/ and th...
Secure AES Key Generation via Salsa20?
The Blum-Micali is a cryptographically secure pseudorandom number generator. The construction (from [wikipedia][1]): * Let $p$ be an odd prime, and let $g$ be a primitive root modulo $p$. * Let $x_0$ be a seed, and let $x_{i+1} = g^{x_i}\ \bmod{\ p}$. * The $i$-th output of the algorithm is 1 if $x_i < \f...
Is it possible to determine or estimate the period for Blum-Micali PRG?