instruction
stringlengths
15
30k
In DGHV FHE, why noise $r$ can be in $(-2^{\rho'}, 0)$?
Rather than making an overly long question even longer, I post this as an answer. As part of the update process of the French security recommendations linked in the question, I suggested (June 2013) a waiver for the requirement/recommendation that $e>2^{16}$ when using a padding scheme with a security proof. It was ...
In a hash function, you map an input of arbitrary length to an output of finite length such that the relationship is one-to-one (or at least that's what you are trying to achieve). Hence, isn't it impossible to have a perfect hashing algorithm? Aren't MD5, SHA-*, all flawed in this respect? Is an "ideal hash" imp...
Are ideal hashes possible to create?
I'm trying to figure out which is the best way to get privacy and integrity together in public cryptography. Alice needs to send multiple files $f$ (may be big) to Bob. I've thought: Alice computes the **hash** of the file $h(f)$. Alice **signs** $h(f)$ with her private key. Alice **encrypts** with Bob's...
I'm trying to figure out which is the best way to get privacy and integrity together in public cryptography. Alice needs to send multiple files $f$ (may be big) to Bob. I've thought: Alice computes the **hash** of the file $h(f)$. Alice **signs** $h(f)$ with her private key. Alice **encrypts** with Bob's...
When I run openssl cms -encrypt -aes256 -in sample.der -out wrapped.der -outform DER -recip ecc.crt -keyopt ecdh_kdf_md:sha512 the part of the CMS output which is supposed to have the 256 bit CEK encrypted under the KEK shows to be 40 bytes: 316:d=7 hl=2 l= 40 prim: OCTET STRING [HEX DUMP...
I have keypair (u,r), and two pieces of data, X and Y. I reveal X publicly but keep Y secret. Y has high entropy. I then combine X and Y, into c(X,Y) = Z. I encrypt Z, into "encrypt(Z,u) = Q". r is needed to decrypt Q back into Z. Can I prove (including interactive zero-knowledge proofs) that Q contains X,...
Proving an encrypted message contains (but does not 100% consist of) a plain-text message?
I have keypair (u,r), and two pieces of data, X and Y. I reveal X publicly but keep Y secret. Y has high entropy. I then concatenate X and Y, into Z. I encrypt Z, into "encrypt(Z,u) = Q". r is needed to decrypt Q back into Z. Later, (when it doesn't matter), r will be revealed and everyone will decrypt Q in...
Proving an encrypted message contains (but does not 100% consist of) a plain-text message? [real]
Proving an encrypted message contains (but does not 100% consist of) a plain-text message?
In the paper [Fully Homomorphic Encryption over the Integers][1], it mentions a symmetric key scheme on page 1 and 2. <b>Key Generation:</b> Pick a random odd number $p \epsilon [2^{N-1},2^N)$<br> <b>Encrypt A Bit m:</b> $c = pq + 2r + m$<br> <b>Decrypt A Bit c:</b> $m = (c \% p) \% 2$<br> <b>Homomorphic XOR:</b>...
In the paper [Fully Homomorphic Encryption over the Integers][1], it mentions a symmetric key scheme on page 1 and 2. <b>Key Generation:</b> Pick a random odd number $p \epsilon [2^{N-1},2^N)$<br> <b>Encrypt A Bit m:</b> $c = pq + 2r + m$<br> <b>Decrypt A Bit c:</b> $m = (c \% p) \% 2$<br> <b>Homomorphic XOR:</b>...
Given public standard RSA exponent = 65537, is there any (d, n) pairs so that RSA decryption becomes a trivial operation? Private key must be no less than 2048-bit. Security is not a factor at all, only simplicity\speed matters (ideally with constant computational complexity).
In the paper [Fully Homomorphic Encryption over the Integers][1], it mentions a symmetric key scheme on page 1 and 2. <b>Key Generation:</b> Pick a random odd number $p \epsilon [2^{N-1},2^N)$<br> <b>Encrypt A Bit m:</b> $c = pq + 2r + m$<br> <b>Decrypt A Bit c:</b> $m = (c \% p) \% 2$<br> <b>Homomorphic XOR:</b>...
Let's assume we're in some scenario requiring transfer of *large* amounts of data. This means we can only use AES-GCM chunk-for-chunk as its maximal size is restricted to a few GiBs. This means we have to define a new nonce (a counter?) for each new chunk. However each chunk needs to have its authentication tag appe...
Can we use the authentication tag as Nonce / IV for the next message?
Let's assume we're in some scenario requiring transfer of *large* amounts of data. This means we can only use AES-GCM chunk-for-chunk as its maximal size is restricted to a few GiBs. This means we have to define a new nonce (a counter?) for each new chunk. However each chunk needs to have its authentication tag appe...
I'm really excited by what I've learned of advancements in elliptic-curve cryptography. [Curve 25519](http://ed25519.cr.yp.to/) seems to be a great choice at this point in time, but if I recall correctly, some elliptic curve algorithms can be compromised during signature generation by a bad RNG: my understanding was th...
Is curve 25519 vulnerable to private key exposure in the case of a bad RNG?
I'm really excited by what I've learned of advancements in elliptic-curve cryptography. [Curve 25519](http://ed25519.cr.yp.to/) seems to be a great choice at this point in time, but if I recall correctly, some elliptic curve algorithms can be compromised during signature generation by a bad RNG: my understanding was th...
I'm really excited by what I've learned of advancements in elliptic-curve cryptography. [Curve25519](http://ed25519.cr.yp.to/) seems to be a great choice at this point in time, but if I recall correctly, some elliptic curve algorithms can be compromised during signature generation by a bad RNG: my understanding was tha...
Is Curve25519 vulnerable to private key exposure in the case of a bad RNG?
Given public standard RSA exponent **e** = 65537, is there any (**d**, **n**) pairs so that RSA decryption becomes a trivial operation? The modulus **n** must be no less than 2048-bit. The goal is to get a real certificate for some internal server that must send same data both via http and https. Certificate auth...
Given public standard RSA exponent **e** = 65537, is there any (**d**, **n**) pairs so that RSA decryption becomes a trivial operation? The modulus **n** must be no less than 2048-bit. The goal is to get a real certificate for some internal server that must send same data both via http and https. Certificate auth...
[![ROTOR ENCRYPTION DEVICE][1]][1][![ENCODING / DECODING PROCEDURE][2]][2] [1]: https://i.stack.imgur.com/zQnMH.jpg [2]: https://i.stack.imgur.com/qNHwc.jpg This device is a modification of the Bazieres cylinder, it has two stacks of 5 rotors which each bear two alphabets plus numbers 0-9, one in correct ord...
This device is a modification of the Bazeries cylinder, it has two stacks of 5 rotors which each bear two alphabets plus numbers 0-9, one in correct order and one in random order ( 36 characters in each row ). Plain text in 5 letter groups is entered by setting the rotors as in Fig 3. The shaded character on the bottom...
How secure is this modified Bazeries Cylinder?
I can find a couple of descriptions of using CFB mode to create a MAC, but cannot find any standard or papers analyzing its security bounds. Is there a standard for CFB-MAC? Where can I find an analysis of its security bounds?
Where is CFB-MAC defined?
In the Massey-Omura three pass protocol: - How many bits long should the prime modulus $M$ be in order to be secure? - Should the $M$ be secret? - Should the $M$ be generated every time or it could be reused to generate new keys?
I'm a computer science student (not a mathematican) and I'm gonna to write a master degree diploma on applied cryptography. Specifically, I'd like to create a realization of some cryptographic stuff that is not widely deployed or even lacks of realizations by some reason (maybe because it's really new or it's just not ...
This device is a modification of the Bazeries cylinder, it has two stacks of 5 rotors which each bear two alphabets plus numbers 0-9, one in correct order and one in random order ( 36 characters in each row ). Plain text in 5 letter groups is entered by setting the rotors as in Fig 3. The shaded character on the bottom...
I have keypair (u,r), and two pieces of data, X and Y. I reveal X publicly but keep Y secret. Y has high entropy. I then concatenate X and Y, into Z. I encrypt Z, into "encrypt(Z,u) = Q". r is needed to decrypt Q back into Z. Later, (when it doesn't matter), r will be revealed and everyone will decrypt Q in...
> How many bits long should the prime modulus $M$ be in order to be > secure? The modulus $M$ should be long enough to prevent discrete logarithms from being comuptable.<br> As of now this means 2048 bits length is fine, but for other (official) recommendations you should consult [keylength.com][1] > Should the...
Is there a practical security difference between OTP with letters and OTP with numbers? If, for instance, I encrypt a letter message, using Tabula Recta, with a random letter key THISI SATES TXAAA - message MOSSK VFXNN EJRQW - OTP key ----------------- FVAKS NFQRF XGRQW - cipher would it be less secure, due t...
Is there a practical security difference between OTP with letters and OTP with numbers?
> How many bits long should the prime modulus $M$ be in order to be > secure? The modulus $M$ should be long enough to prevent discrete logarithms from being computable. As of 2015 this means 2048 bits length is fine, but for other (official) recommendations you should consult [keylength.com][1] > Should the $M...
Is there a practical security difference between OTP with letters and OTP with numbers? If, for instance, I encrypt a letter message, using Tabula Recta, with a random letter key THISI SATES TXAAA - message MOSSK VFXNN EJRQW - OTP key FVAKS NFQRF XGRQW - cipher would it be less secure, due to frequency ana...
Is there a practical security difference between OTP with letters and OTP with numbers? If, for instance, I encrypt a letter message, using Tabula Recta, with a random letter key THISI SATES TXAAA - message MOSSK VFXNN EJRQW - OTP key FVAKS NFQRF XGRQW - cipher would it be less secure, due to frequency ana...
In the paper [Fully Homomorphic Encryption over the Integers][1], it mentions a symmetric key scheme on page 1 and 2. <b>Key Generation:</b> Pick a random odd number $p \epsilon [2^{N-1},2^N)$<br> <b>Encrypt A Bit m:</b> $c = pq + 2r + m$<br> <b>Decrypt A Bit c:</b> $m = (c \% p) \% 2$<br> <b>Homomorphic XOR:</b>...
Can the keystream generated by CTR mode be considered a pseudo-random function? I give more information. Assume $f$ is a PRF. We define a function which takes 2 inputs, the desired length, and an arbirtrary value: $F_l(r):=f(r\cdot l \cdot 1) \cdot f(r \cdot l \cdot 2) \cdot \cdots\cdot f(r\cdot l\cdot l-1)\cdot ...
This device is a modification of the Bazeries cylinder, it has two stacks of 5 rotors which each bear two alphabets plus numbers 0-9, one in correct order and one in random order ( 36 characters in each row ). Plain text in 5 letter groups is entered by setting the rotors as in Fig 3. The shaded character on the bottom...
> How secure is this modified Bazeries Cylinder? That depends on what you expect us to compare it to. I doubt you’re looking for an answer along the lines of *“it’s more secure than a Scytale, but less secure than AES”*. But generally, it is safe to assume it can not – in any way – provide security which would be co...
> How secure is this modified Bazeries Cylinder? That depends on what you expect us to compare it to. I doubt you’re looking for an answer along the lines of *“it’s more secure than Scytale, but less secure than AES”*. Therefore, I will try to narrow it down a bit by saying that it is safe to assume it can not – in ...
> How secure is this modified Bazeries Cylinder? That depends on what you expect us to compare it to. I doubt you’re looking for an answer along the lines of *“it’s more secure than Scytale, but less secure than AES”*. Therefore, I will try to narrow it down a bit by saying that it is safe to assume it can not – in ...
Hope you're having a nice day. I need to implement an authentication system between a "document" (it's not exactly a document, but an object without any computing capacity, only able to store information) and a computer. The document will have some sort of information stored there by the computer, and then it will ...
I have some difficulty to understand in which way the Server is really authenticated by Client in TLS handshake. . when Client receives Server ‘s Certificate and verifies it with using CA root public key, I fully understand that at this time, Client can consider that such received Certificate is valid and authentic...
TLS Handshake : Server authentication or only Server ‘s Certificate authentication?
I have some difficulty to understand in which way the Server is really authenticated by Client in TLS handshake (in case of using RSA key exchange) . when Client receives Server ‘s Certificate and verifies it with using CA root public key, I fully understand that at this time, Client can consider that such received...
I have some difficulty to understand in which way the Server is really authenticated by Client in TLS handshake (in case of using RSA key exchange) When Client receives Server ‘s Certificate and verifies it with using CA root public key, I fully understand that at this time, Client can consider that such received Ce...
> But if Server’s certificate is checked sucessfully by Client, how is > it possible to consider that Server has been authenticated by Client, > while at this time none message signed with Server’s private key has > been sent to the Client and verified by it ? If only consider the key exchange to be what the RFC ...
Suppose I encrypted a homophonic substitution cipher at the level of syllables, trigrams, digraphs, and individual letter with a Vigenere cipher using the keyword cryptography. I would then encrypt the resulting complex ciphertext with an ADFGVX cipher in addition to using a code. How strong can a multiple-encryption b...
How strong can multiple encryption be?
Suppose I have access to an LFSR generator output used in a radio communications system, with the LFSR being used to authenticate devices. The system cycles an internal unknown length LFSR (greater than 32 bits) an unknown but constant number of times and returns the truncated upper 32 bits, with the lower bits being u...
Given occasional LFSR samples can the next sample be computed?
Similar questions have been asked regarding use of time in true random number generation, but I'd like to consider using time as just one source of entropy, complementing others. True random number generation relies on the mensuration of some physical stochastic process. Electrons avalanche across depletion boundar...
Is it okay to include relative time for true random number generation?
> Who can tell when my machine was booted? Anyone who observed it go on, at least. That could include someone sniffing your wlan traffic. However, if the computer in question is a shared server, anyone with access can probably call `uptime`. > After all, /dev/random uses timings for it's cryptographically secure ...
Similar questions have been asked regarding use of time in true random number generation, but I'd like to consider using time as just one source of entropy, complementing others. True random number generation relies on the mensuration of some physical stochastic process. Electrons avalanche across depletion boundar...
I have some difficulty understanding the way in which the Server is really authenticated by Client in TLS handshake (in case of using RSA key exchange). When Client receives Server ‘s Certificate and verifies it with using CA root public key, I fully understand that at this time, Client can consider that such receiv...
I was recentely think about password hashing (maybe caused by the [PHC][1] progression). I started to think a little more about it and got stuck at this question: **What security properties do password-hashing related salts actually *need***? I think they need to be globally unique (that's how I usually constr...
What are the required security properties for salts?
I know that there exist some attack when using same modulus. [Can two different pairs of RSA key have the same modulus?](http://crypto.stackexchange.com/questions/2516/can-two-different-pairs-of-rsa-key-have-the-same-modulus) [RSA cracking: The same message is sent to two different people problem](http://crypto.s...
I know that there exist some attack when using same modulus.<br> [Can two different pairs of RSA key have the same modulus?][1]<br> [RSA cracking: The same message is sent to two different people problem][2] But with a little modification, $m$ is the plain-text $N$ is the RSA modulus $r_1, r_2$ is the r...
Suppose we have the following symmetric algorithm: key = random bits G = PRNG(seed: key) input = [0,1,1,0,1,0,0,0, 0,1,1,0,1,0,0,1] // "hi" in ascii The key can be thought of as a sufficiently large bit string (say 256 bits). encrypted = [] for each decrypted_bit in input random...
How to break this PRNG encryption scheme?
Suppose we have the following symmetric algorithm: key = random bits G = PRNG(seed: key) input = [0,1,1,0,1,0,0,0, 0,1,1,0,1,0,0,1] // "hi" in ascii The key can be thought of as a sufficiently large bit string (say 256 bits). encrypted = [] for each decrypted_bit in input random...
I was recently thinking about password hashing (maybe caused by the [PHC][1] progression). I started to think a little more about it and got stuck at this question: **What security properties do password-hashing related salts actually *need***? I think they need to be globally unique (that's how I usually cons...
Hope you're having a nice day. I need to implement an authentication system between a "document" (it's not exactly a document, but an object without any computing capacity, only able to store information) and a computer. The document will have some sort of information stored there by the computer, and then it will ...
The question pretty much sums it up. Is there any way to make an attacker who is successfully performing an MITM attack to _actually_ not be able to read or change the messages? Assuming there is no pre-attack key transfer or an agreed upon key that isn't transferred mid-attacking conversation.
Is there really any way to nullify or avoid MITM attacks?
**Please Consider**: English is My Second Language ---------- [This][1] Wikipedia article on HMACs shows a part of a HMAC-MD5 implementation making use of `i_key_pad` and `o_key_pad`: # [...] def hmac_md5(key, msg): if len(key) > blocksize: key = md5(key).digest() ...
In HMAC-MD5 Implementation, why "i_key_pad" and "o_key_pad" if They Are Public and Constant?
I am trying to understand a concept of CPA and CCA attack and I cannot get one thing from the definition. If an attacker can execute a CPA attack for something like *Send 100 dollars to attacker* that will mean he will get a valid encryption for this message. Now in the definition of the CCA attack is that the adv...
"What prevents an attacker from just sending the received ciphertext <br> to the recipient who will think that this is the legitimate message?" Nothing. $\:$ (In that case, the recipient will be correct.) <br> Why "in the definition" is the attacker "only allowed to send another" message? <br><br><br> If h...
I am trying to understand a concept of CPA and CCA attack and I cannot get one thing from the definition. If an attacker can execute a CPA attack for something like *Send 100 dollars to attacker* that will mean he will get a valid encryption for this message. Now according to the definition of the CCA attack the ad...
The result of the cipher should be indistinguishable from random, but can it happen that cipher produces the ciphertext that is equal to the plaintext as it also lies in the corresponding space? I guess it's just the probability is extremely low, probably equal to guessing the clear text on the first attempt, but just ...
The result of the cipher should be indistinguishable from random, but can it happen that cipher produces the ciphertext that is equal to the plaintext as it also lies in the corresponding space? I guess it's just the probability is extremely low, probably equal to guessing the clear text on the first attempt, but just ...
Where can i find open source code about the basic Quisquater-Piret DFA of AES-128? Are there any websites sharing the code about such physical attacks?
So let's assume I want to perform Ed448 or Ed25519 digital signatures or want to perform a DH key-exchange. Assume further that those curves (Curve448 or Curve25519) are *required*. But the problem is, that I have only a constrained device given, which only allows for Weierstrass-Computations. Alternatively I have a...
Edwards / Montgomery ECC with Weierstrass Implementation?
I'm trying to better understand simulation based proofs in the UC model - but the guidelines to construct a simulator confuse me. To my understanding, the simulator is activated in two ways: 1. Outbound: S simulates the real world adv. A and as such, it intercepts all its messages and sends them to the ideal functio...
If I understand your question correctly, you are essentially asking if points in Edwards and Montgomery curves can be represented in Weierstrass coordinates. This is true; in fact, *any* elliptic curve over a prime field can be represented in Weierstrass form $\mathcal{E}_{w}^{a, b} : y^2 = x^3 + ax + b$, and by extens...
If I understand your question correctly, you are essentially asking if points in Edwards and Montgomery curves can be represented in Weierstrass coordinates. This is true; in fact, *any* elliptic curve over a prime field can be represented in Weierstrass form $\mathcal{E}_{w}^{a, b} : y^2 = x^3 + ax + b$, and by extens...
Similar questions have been asked regarding use of time in true random number generation, but I'd like to consider using time as just one source of entropy, complementing others. True random number generation relies on the mensuration of some physical stochastic process. Electrons avalanche across depletion boundar...
How do I create a PKCS#7 or CMS enveloped signature in python?
In the paper [Fully Homomorphic Encryption over the Integers][1], it mentions a symmetric key scheme on page 1 and 2. <b>Key Generation:</b> Pick a random odd number $p \epsilon [2^{N-1},2^N)$<br> <b>Encrypt A Bit m:</b> $c = pq + 2r + m$<br> <b>Decrypt A Bit c:</b> $m = (c \% p) \% 2$<br> <b>Homomorphic XOR:</b>...
So let's assume I want to perform Ed448 or Ed25519 digital signatures or want to perform a DH key-exchange. Assume further that those curves (Curve448 or Curve25519) are *required*. But the problem is, that I have only a constrained device given, which only allows for Weierstrass-Computations. Alternatively I have a...
I implemented and used the P-521 curve for ECDSA. Signatures are 132 bytes long. It seems that Edwards E-521 is safer but I did not investigated very deeper. What is its signature length ? How is it better ? What library (C and Python) would you recommend to use it ?
Whar are the differences between curve NIST P-521 and Edwards E-521 for signature?
It is not true that there would always be at most two hashes required per elided range. Suppose you have an eight-byte long content and want to elide all but the last. You need to supply one hash for the left half, one to cover the next two and one more to cover the last one. Similarly, with 16 bytes of content, ...
I have an unchanging set of unique items, and I want my server to show one of those items to a client, then cryptographically prove that the item is part of the set. How I do this currently: 1. Generate a Merkle tree containing all of the items. 2. Give the client the Merkle root, (32 bytes) out of band. 3. ...
I implemented and used the P-521 curve for ECDSA. Signatures are 132 bytes long. It seems that Edwards E-521 is safer but I did not investigated very deeper. What is its signature length ? How is it better ?
For a scheme to be at least CPA secure, one has to randomize the scheme. In case of a secret key encryption scheme, the used randomness will typically become part of the cipher text as in the case of an IV and is "public" (This is not a necessary requirement but how most algorithms work). Now, if I switch to public ...
Using magic, I've built a machine that instantly generates hash collisions. To try it out, I set the dial to SHA256 and typed in "e7cf3ef4f17c3999a94f2c6f612e8a888e5b1026878e4e19398b23bd38ec221a". I hit the button and it showed me a long sequence of bytes starting with "09F7E02F1290BE211DA707A266F153B3...". I hit th...
From the literature, it looks like the security proofs of sponge functions depend on how well they approximate a random permutation, Since a block cipher also ideally behaves like a random permutation does that mean strong block ciphers make for strong sponge functions? As in, can I expect: extern char *input...
Such a scheme would have two effects against an attacker trying to analyze the frequency of words and word combinations: 1. They would need more samples to differentiate between two tokens at the same level of confidence. 2. For two different tokens with similar frequency they would no longer know that the words di...
> So, here's my question: is there a point where the salt size doesn't matter anymore in terms of security and where it might even decrease it? The purpose of a salt is to prevent the attacker from targeting multiple users' passwords with the same try or caching common passwords' hashes in a table. You need enough s...