instruction
stringlengths
15
30k
I'm making a REST application and still a bit confused about this issue. basically, to authenticate incoming requests, I give out userId, issued timestamp, expiry timestamp (normally 3 months after issue) and the signature for client to use for next requests. for every incoming requests, server will use userId, issued...
Let $n=pq$ be the RSA module and at least one of $p,q$ is a weak prime.It is proved that the number of such $1024$bit $n$ is at least $2^{759}$. With lattices we can factor these $n$ in a second (I implemented it). Are you know the methods that are more powerful than this method?
Application uses AES in CBC mode with 128 bit key. In this implementation key is always same and is equal to IV. Can attacker get the key or decrypt data? If he knows: 1. First and second blocks of plaintexts; 2. All blocks of ciphertexts. The software mentioned above is malicious program, it encrypts all offic...
Is it okay to make both the IV and the Password salt public for the AES-128 bit encryption in CFB/No-padding mode.Does this action of mine compromise security in any way.I have an implementation of this cipher and had previously asked a [question][1] about this cipher on stack Overflow. One of the user who answered my ...
Does this compromise security?
I am reading this spec and it says: "The creation of all nonce values MUST use the next n bits from the TPM RNG." I do not know what this means, or how to find out what it means. What is the next n bits? There is really no other comment on this section. The document name is "TPM Main-Part 1 Design Principle..."
Hash functions generally (always ?) take a variable size input that's why they are also called compression functions. The hash functions are also generally collision resistant, or they are designed in such aim for cryptographic applications. What you are describing is a particular category of one way function (OWF). T...
Is it okay to make both the IV for AES-CFB and the salt for PBKDF2 public? Does this action of mine compromise security in any way? I have an implementation of this cipher and had previously asked a [question][1] about this cipher on stack Overflow. One of the users who answered my question told that it is OK to ma...
change in bits leads to change in rounds the reason?
I have one sender, and a small number (~5) of recipients. The sender knows each recipient's public EC key. I want the sender to broadcast a single message in such a way that any one of the recipients can decrypt it. For reasons that aren't completely technical, I'd like the security properties of the encryption algorit...
So I think I understand a good amount of the theory behind elliptic curve cryptography, however I am slightly unclear on how exactly a message in encrypted and then how is it decrypted. So my questions are - How are messages encrypted and decrypted? - How are the public and private keys determined? Thanks for...
How does encryption work in elliptic curve cryptography?
> How are messages encrypted and decrypted? Well, the easiest way to do public key encryption with ECC is to use [ECIES][1]. In this system, Alice (the person doing the decryption) has a private key $a$ (which is an integer) and a public key $A = aG$ (which is an EC point); she publishes her public key $A$ to every...
I am reading [TPM Main Part 1 Design Principles](https://www.trustedcomputinggroup.org/files/resource_files/646BE624-1D09-3519-ADDA61BE37A21A74/mainP1DPrev103.pdf) (PDF) which states: > The creation of all nonce values MUST use the next n bits from the TPM RNG. I do not know what this means, or how to find out wh...
I am reading [TPM Main Part 1 Design Principles](https://www.trustedcomputinggroup.org/files/resource_files/646BE624-1D09-3519-ADDA61BE37A21A74/mainP1DPrev103.pdf) (PDF) which states: > The creation of all nonce values MUST use the next $n$ bits from the TPM RNG. I do not know what this means, or how to find out ...
The requirement was introduced in [IUT Recommendation X.509 (November 1993)][1], informative appendix D.5.2: > It must be ensured that e > log<sub>2</sub>(n). If not, then the simple operation of taking the integer e<sup>th</sup> root of a ciphertext block will disclose the plaintext. This advice was removed in t...
I am Reading RSA and Public-Key Cryptography by Mollin and I can't make out how *El Gamal* is different from *Diffie Hellman Key Exchange*. Any thoughts?
The requirement was introduced in [IUT Recommendation X.509 (November 1993)][1], informative appendix D.5.2: > It must be ensured that e > log<sub>2</sub>(n). If not, then the simple operation of taking the integer e<sup>th</sup> root of a ciphertext block will disclose the plaintext. This advice was removed in t...
For what kind of usage should we prefer using Diffie-Hellman in order to exchange keys instead of ElGamal, and most important why should we use one or the other? I do not see a clear difference between these two algorithms. What are their respective advantages?
I'm making a REST application and still a bit confused about this issue. basically, to authenticate incoming requests, I give out userId, issued timestamp, expiry timestamp (normally 3 months after issue) and the signature for client to use for next requests. for every incoming requests, server will use userId, issued...
Keys and key-stretching when authenticating requests?
I am learning the construction of Davies-Meyer to construct a hash function from block ciphers. The definition that I found is $$H_i=E_{m_i}(H_{i-1})\oplus H_{i-1}.$$ where $E_k$ is a block cipher with key $k$. My questions are: 1) Who is $H_0$, is the Initial Value (IV) as any hash function, that is Is th...
I am looking at [TPM Main-Part 1 Design Principles_v1.2_rev116_01032011][1] and on page 69 of pdf, equivalent to page 57 of the document itself,there is comment on physical presence as follows: "Observe, the reverse logic surrounding the use of TSC_PhysicalPresence command. When the physicalPresenceCMDEnable flag is se...
I am learning the construction of Davies-Meyer to construct a hash function from block ciphers. The definition that I found is $$H_i=E_{m_i}(H_{i-1})\oplus H_{i-1}.$$ where $E_k$ is a block cipher with key $k$. My questions are: 1) Who is $H_0$, is the Initial Value (IV) as any hash function, that is Is th...
Is the IV value in Davies Meyer construction public?
Novice here. Is there a MPC function where no information is leaked even if all parties are not trustworthy ?
This is not quite an answer, because what I'll discuss is only about as powerful as the attack in the question, which refers to section 3 onwards in: Abderrahmane Nitaj and Tajjeeddine Rachidi, _Factoring RSA moduli with weak prime factors_ (2015-05 [eprint][1]). The method I'll discuss is acknowledged in section 2....
This is not quite an answer, because what I'll discuss is only about as powerful as the attack in the question, which refers to section 3 onwards in: Abderrahmane Nitaj and Tajjeeddine Rachidi, _Factoring RSA moduli with weak prime factors_ (2015-05 [eprint][1]). The method I'll discuss is acknowledged in section 2....
This is not quite an answer, because what I'll discuss is only about as powerful as the attack in the question, which refers to section 3 onwards in: Abderrahmane Nitaj and Tajjeeddine Rachidi, _Factoring RSA moduli with weak prime factors_ (2015-05 [eprint][1]). The method I'll discuss is acknowledged in section 2....
> Is that value $H_0$ public? Well, one property that a hash function has is that anyone can evaluate it. To evaluate a Davies-Mayer hash, you need the value $H_0$, and so yes, it needs to be public. > I think that is necessary to complete with zeros until complete 64 bits... Minor correction there: while Dav...
This is not quite an answer, because what I'll discuss is only about as powerful as the attack in the question, which refers to section 3 onwards in: Abderrahmane Nitaj and Tajjeeddine Rachidi, _Factoring RSA moduli with weak prime factors_ (2015-05 [eprint][1]). The method I'll discuss is acknowledged in section 2....
I need a cryptosystem that is additively homomorphic. Paillied preferably, but not neccessarily. Also, for every ciphertext the private key holder must be able to prove non-interactively that the plaintext was non-negative. In Paillier it is rather simple to prove that the ciphertext is equal to the plaintext. Th...
I need a cryptosystem that is additively homomorphic. Paillier preferably, but not neccessarily. Also, for every ciphertext the private key holder must be able to prove non-interactively that the plaintext was non-negative. In Paillier it is rather simple to prove that the ciphertext is equal to the plaintext. Th...
This is probably a simple question, but I haven't been able to see it stated anywhere. Is it possible to directly encrypt a file (of any length) with some form of EC using the 25519 curve. I know it's common to exchange a key with EC and then use symmetric encryption (AES) to encrypt a file, however I was curious i...
Can elliptic curve (25519) be used to encrypt file?
A signature algorithm should - in general - be thought to contain the hashing method as parameter. Take for instance RSA / PSS. RSA / PSS includes the [ EMSA-PSS-ENCODE](https://tools.ietf.org/html/rfc3447#section-9.1.1) operation. Here the hash function to use is an option to the algorith. Step 2 is: > Let mHash...
I am reading the [TPM Main-Pat 1 Design Principles_v1.2][1] and do not feel I fully understand the example they give on how the counters would work. Apparently monotonic counters are used to prevent reply attacks. I wonder if there is content somewhere, which would explain how the a register like the internal base regi...
I am reading the [TPM Main-Pat 1 Design Principles_v1.2][1] and do not feel I fully understand the example they give on how the counters would work. Apparently monotonic counters are used to prevent replay attacks. I wonder if there is content somewhere, which would explain how the a register like the internal base ...
I am reading the [TPM Design Principles v1.2][1] §17 and do not feel I fully understand the example they give on how the counters would work. Apparently monotonic counters are used to prevent replay attacks. I wonder if there is content somewhere, which would explain how the a register like the internal base registe...
In the articles about cryptography I see the words _Hardware implemented_ and _Software implemented_. I'm curious to know what is the difference between them? In the other words, even in the computer when I write a program to do a crypto algorithm, I finally run it on CPU. So why I couldn't call it hardware impleme...
Difference between Hardware implemented algorithm and software implemented one?
I have read some content on trusted execution environment, and I like to ask exactly how it improves hashing. What I read at [Wikipedia’s “Trusted Execution Technology” article](https://en.wikipedia.org/wiki/Trusted_Execution_Technology) states: > ...PCRs) which hold various measurements in a shielded location in a...
How does Intel TXT prevent spoofing of PCR values?
I have been reading and thinking about timing attacks on cryptographic systems. The answer to [this question](http://crypto.stackexchange.com/questions/24275/defence-against-timing-attacks) mentions the following: "The way to defend against timing attacks is to make sure the time taken to execute cryptographic opera...
I am reading the [TPM Design Principles v1.2][1] §17 and do not feel I fully understand the example they give on how the counters would work. Apparently monotonic counters are used to prevent replay attacks. I wonder if there is content somewhere, which would explain how the a counter like the internal base counter ...
I am reading the [TPM Design Principles v1.2][1] §17 and do not feel I fully understand the example they give on how the counters would work. Apparently monotonic counters are used to prevent replay attacks. I wonder if there is content somewhere, which would explain how the a counter like the internal base counter ...
Quoting from the [Million Dollar Curve website](https://cryptoexperts.github.io/million-dollar-curve/): > By using publicly verifiable randomness produced in February 2016 by many national lotteries from all around the world, we propose to generate a cryptographically secure elliptic curve for the ECDH cryptosystem...
hey guys we are working on aes and wanted to develop a website which will be provide encryption facility but we are not understanding the difference between key and the block size..more appropriately what does 128,192,256 bit key means ?please explain with the help of an example
We are working on AES and want to develop a website which should provide an encryption facility but we are not understanding the difference between key and the block size. More appropriately what does a 128, 192 and 256 bit key mean?
You may already have noticed that most smart cards ship with 2048-bit RSA support and 320-bit ECC over GF(p) support. You may have already asked yourself "why exactly 320-bit?". Now I remember having read a while ago (I can't find the reference sorry), that you can use the 2048-bit RSA to somehow hack together 320-bit ...
Why is 2048-bit RSA always paired with 320-bit ECC?
You may already have noticed that most smart cards ship with 2048-bit RSA support and 320-bit ECC over GF(p) support. You may have already asked yourself "why exactly 320-bit?". Now I remember having read a while ago (I can't find the reference sorry), that you can use the 2048-bit RSA to somehow hack together 320-bit ...
Considering the following encryption scheme where RSA is used to encrypt a plaintext **m** and then we choose a random **r** and compute: $$A = r + m^e mod N$$ and $$B = r^e mod N$$ So the ciphertext is a pair: $$(A,B)$$ and to recover **m** we compute: $$m = (B^d - A)^d mod N$$ IMHO This scheme has not randomized enc...
I've been going through DES, and I find that most of the blocks simply Reshuffle the input, which may be termed as "Cross Wiring". This include IP, IP-1, PC-1, PC-2 and even Expansion(although this seems to be more useful than the rest). Why does DES do it? Is it for a reason, or just for fun maybe?
Why does DES implement so much Cross Wiring?
Considering the following encryption scheme where RSA is used to encrypt a plaintext **m** and then we choose a random **r** and compute: $$A = r + m^e \bmod N$$ and $$B = r^e \bmod N$$ So the ciphertext is a pair: $$(A,B)$$ and to recover **m** we compute: $$m = (B^d - A)^d \bmod N$$ IMHO This scheme has not randomiz...
So a vigenere cipher's main weakness is that you can use frequency analysis on each alternated alphabet, and thus crack the cipher with relative ease... But that implies that you know what the frequency of the plaintext is. So what if you hybridized vigenere cipher with some other algorithm that obscured the frequen...
What is the viability of a hybrid vigenere cipher?
My own understanding (possibly wrong of course) of RSA-OAEP encryption scheme is that it provides plaintext integrity (in addition to confidentiality) due to MGF function which for encryption operation, applies to maskeDB sequence which value directly depends of input M (plaintext) message, and is further checked duri...
Does rsa-oaep provide or not plaintext integrity in addition to confidentiality?
I have a problem, If I have p = p-192 = 2^192 -^ 264 -1 with the base-2^64 so, 2^192 = 2^64 +1 (mod p) the same that (p= p-192) or 2^256 = 2^128 + 2^64 (mod p) or 2^320 = 2^128 + 2^64 +1 (mod p) could you help me, please? I don't understand for example like 2^256 = 2^128 + 2^64 (mod p) Thank you so much...
A big drawback of end-to-end encrypted messaging services is that, as soon as you lose your device, you lose all your messages. Your private key is gone after all. I was wondering though, wouldn't it be possible to do the following in a chat app for iOS, using certificate pinning and TLS for all communication with the ...
I'm a little unclear on how hash based MAC works... So I would like to know, is the security of your hash function as important as the security of the overall cipher? Basically, if you can crack the hash, does this compromise the cipher? I understand that in most situations it isn't particularly feasible to crack ei...
Is the security of an HMAC equally important as the security of the cipher itself?
Inside each round, DES has a permutation that is used for diffusion and is crucial for security. However, you rightly point out that the initial and final permutations on the block of input/output and on the key have *no effect whatsoever* on security. Formally, it's not difficult to show that if you have an attack on ...
Based on your comment: >Correct... But it looks like many HMAC systems basically end up including a hash of the plaintext+key alongside the ciphertext. So it seems like cracking that hash would effectively compromise the entire encryption, no? you may have a misunderstanding of how HMAC is used as part of a crypt...
A big drawback of end-to-end encrypted messaging services is that, as soon as you lose your device, you lose all your messages. Your private key is gone after all. I was wondering though, wouldn't it be possible to do the following in a chat app for iOS, using certificate pinning and TLS for all communication with the ...
I've been going through DES, and I find that most of the blocks simply Reshuffle the input, which may be termed as "Cross Wiring". This include IP, IP-1, PC-1, PC-2 and even Expansion (although this seems to be more useful than the rest). Why does DES do it? Is it for a reason, or just for fun maybe?
In some virtualized environments, the only source of entropy available is CPU timing jitter. Can one get enough entropy from this source for practical uses? "enough" in this context means "enough to seed a CSPRNG" (256 bits?)
Is CPU timing jitter a usable entropy source?
Is there any way to generate - cryptographically secure - uniformly distributed floating point numbers in the interval [0,1)? For example, in Javascript, there is `Math.random()`, which yields these (pseudo-random) numbers, yet not cryptographically secure. There are several algorithms at http://stackov...
Is there any way to generate - cryptographically secure - uniformly distributed floating point numbers in the interval [0,1)? For example, in Javascript, there is `Math.random()`, which yields these (pseudo-random) numbers, yet not cryptographically secure. - There are several algorithms at http://stack...
I have a problem, If I have $p = \text{P-192} = 2^{192} - 2^{64} - 1$ with the base $2^{64}$ so, $2^{192} = 2^{64} + 1 \pmod p$ the same that $(p=\text{P-192})$ or $2^{256} = 2^{128} + 2^{64} \pmod p$ or $2^{320} = 2^{128} + 2^{64} +1 \pmod p$ Could you help me, please? I don't understand for example like ...
How to count number of points on elliptic curve over binary field?
In some virtualized environments, the only source of entropy available is CPU timing jitter. Can one get enough entropy from this source for practical uses? Also, is this secure against local side-channel attacks against unprivileged local attackers? "enough" in this context means "enough to seed a CSPRNG" (256 bi...
The [Blowfish][1] cipher uses a so called `F`-function which uses [S-Boxes][2] (`S[i]`, `i=0,1,2,3`) to chiffre an integer `x`, for which I've seen different versions: 1) uint32_t F (uint32_t x) { uint32_t h = S[0][x >> 24] + S[1][x >> 16 & 0xff]; return ( h ^ S[2][x >> 8 & 0xff] ) + S[3][x &...
What is the correct definition of the blowfish F-function?
I have a problem, If I have $p = \text{P-192} = 2^{192} - 2^{64} - 1$ with the base $2^{64}$ so, $2^{192} = 2^{64} + 1 \pmod p$ the same that $(p=\text{P-192})$ or $2^{256} \equiv 2^{128} + 2^{64} \pmod p$ or $2^{320} \equiv 2^{128} + 2^{64} +1 \pmod p$ Could you help me, please? I don't understand for exa...
I have a problem, If I have $p = \text{P-192} = 2^{192} - 2^{64} - 1$ with the base $2^{64}$ so, $2^{192} \equiv 2^{64} + 1 \pmod p$ the same that $(p=\text{P-192})$ or $2^{256} \equiv 2^{128} + 2^{64} \pmod p$ or $2^{320} \equiv 2^{128} + 2^{64} +1 \pmod p$ Could you help me, please? I don't understand fo...
What is the default algorithm used by the MIRACL-Library [1] for elliptic curve cryptography systems to perform scalar-point multiplication with curves of Weierstrass form satisfying the equation : $y^2 = (x^3 + a \times b + b)$ (modulo $p)$ defined over a prime Field $\mathbb{F}_p$ ? ---- [1] https://github.com...
[This question](http://crypto.stackexchange.com/questions/31664/is-there-an-asynchronous-encryption-algorithm-where-the-public-key-cannot-be-der), and fkraiem's answer to it, made me wonder about the security and practicality of using "symmetric RSA" to provide a partially compromise-resistant secure channel. Specif...
Could this "symmetric RSA" scheme provide key compromise resistant communications?
What is the default algorithm used by the MIRACL-Library [1] for elliptic curve cryptography systems to perform scalar-point multiplication with curves of Weierstrass form satisfying the equation : $y^2 = (x^3 + a \times b + b)$ (modulo $p)$ defined over a prime Field $\mathbb{F}_p$ ? I can't find any satisfying in...
What is the default algorithm used by the MIRACL-Library [1] for elliptic curve cryptography systems to perform scalar-point multiplication with curves of Weierstrass form satisfying the equation : $y^2 \equiv (x^3 + a\cdot x + b)\pmod p$ defined over a prime Field $\mathbb{F}_p$ ? I can't find any satisfying infor...
I have a question, I read the k friedman test to determine the period of a vigenere cipher text, and I understand something like this: Friedman's K test tries to find out what period of the cipher by calculating some values of > K(C,C^n)n , where C^n is the ciphertext with n shifts to the left, thereby determin...
Keccak/SHA-3 is new NIST standard for cryptographic hash functions. However, it is much slower than Blake-2 in software implementations. Does Keccak have compensating advantages?
What advantages does Keccak have over Blake-2?
In Schnorr's digital signature protocol (https://en.wikipedia.org/wiki/Schnorr_signature), the signing process (as described in wikipedia) requires the generation of a random bit $r$. I am wondering how necessary it is for this bit to in fact be randomly generated. For example, what if I generate my ith $r$ as $Q(i)$ ...
How to count number of rational points on elliptic curve over binary field?
I am writing a (high-school) paper on the public key exponent's (in *textbook* RSA - no padding is discussed!) significance in terms of time and security. The time part is done; as for the security part, so far I have shown example of various attacks that can take place when the public key is low (e.g. $e$ root attack,...
I have a question, I read the k friedman test to determine the period of a vigenere cipher text, and I understand something like this: Friedman's K test tries to find out what period of the cipher by calculating some values of > K(C,C^n)n , where C^n is the ciphertext with n shifts to the left, thereby determinin...
MD5 is considered broken and SHA-1 is closely following, but HMACs built around either are still considered relatively secure. It makes me wonder if MD5 and SHA-1 HMACs can be used as secure hashes. 1. Settle on some constant $C$ that will serve the role of $K$. 2. Define a new hash algorithm as $H_C(x)=HMAC(C, x)$...
Could an HMAC be used as a hash?
How to do the benchmarking of a self implementation of AES algorithm using NIST test suites? Not able to find enough material on net regarding this
How to do the benchmarking of a self implementation of AES algorithm using NIST test suites? I am unable to find enough material on the internet regarding this.
Lattice cryptography is a post quantum cryptography that work on two NP-hard problem in below: 1.Find shortest nonzero vector from origin and 2. Find minimum distance of a arbitrary point out of lattice from origin. nowadays lattice cryptography system is broken with key space of dimension 300. In the other hand we u...
Is secure lattice based cryptography in future?
Lattice cryptography is a post quantum cryptography that work on two NP-hard problem in below: 1. Find shortest nonzero vector from origin and 2. Find minimum distance of a arbitrary point out of lattice from origin. At the moment lattice cryptography system is broken with key space of dimension 300. On the o...
Is it feasible to have data encrypted at different levels of hierarchy I'd like to encrypt an xml database (such as used in [www.keepass.info][1]) whereby two or more keys can exist. For example: 1. <kbd>Key #1</kbd> decrypts the entire database file 2. <kbd>Key #2</kbd> decrypts a subset of the database file ...
I am studying the Winternitz signature and I describe its algorithms in the next **W-OTS Key Generation**. Select the parameter $w\geq 2$ that is the bit size of the partitions of the message to be signed. Compute the number of partitions $$t_1 = \Big \lceil \dfrac{r}{w} \Big\rceil,$$ and parameter $$t_2 = ...