instruction
stringlengths
15
30k
How can I implement the "Multiplication Modulo" and "Addition Modulo" operations in IDEA?
This question is a bit different from other questions here, but I think it is suitable to correctly understand the terminology of cryptography. Consider the following two sets of terms: - Encryption scheme, signature scheme - Identification scheme, commitment scheme, secret-sharing scheme The latter are actua...
Suppose I have a file with random binary strings of the same length in each line. If I m computing the conditional entropy H(Y|X) where Y is the variable string of fixed length l which is after X and X is the variable string of length m and i find say lets say l=5 and m=10 that the value of conditional entropy is 3. Do...
### Scenario: * We have a central server $S$. * We have a number of peripheral servers $P_i$ * We have some individuals $U_j$ * A given individual may be "known" to one or more peripheral servers. Each peripheral server generates unique IDs for the individuals it knows and stores a map $f_i: U_j \to \textrm{ID}$ ...
Is secure remote snap possible?
How to construct a variable length IND-CPA cipher from a fixed length one?
Suppose that I want to verify the correctness of the following equation: $q_1(s)*P_1(s)+q_2(s)*P_2(s)+\ldots+q_n(s)*P_n(s) = 1$ Where each $P_i(s)=\prod_{x \in S}{(x+s)}$ for some secret $s$ that the prover which is the [Extended Euclidean algorithm][1]. The prover wants to compute these $q_i(s)$ and he sends me...
How can I use bilinear maps to verify the correctness of the Extended Euclidean algorithm?
Are there any stream ciphers (or a deterministic random number generators, that should work as well I guess?) that cannot be parallelized? So for example if I seed it with a specific value, and then "run" it for a year, generating more and more bits, and finally get a bitstream off it, then that bitstream will be impo...
Addition modulo $2^{16}$ just means, add the two numbers as you normally would, and subtract $2^{16}$ from the result until the sum is less than $2^{16}$. So suppose you wanted to add, say, 51995 and 29291 modulo $2^{16}$: 51995 + 29291 = 81286 Subtract 2^16 = 65536, you get 81286 - 65536 = 15750 ...
I have a need to encrypt credentials for a third-party app used by a secured internal app. Over on ITSec.SE, I was helpfully shown a scheme to encrypt the third-party credentials based on a hash of the credentials for the internal app. I picked AES as the encryption algorithm, but the problem is that the password-b...
Is AES secure if a known and/or fixed IV is used?
Is AES in CBC mode secure if a known and/or fixed IV is used?
I have a need to encrypt credentials for a third-party app used by a secured internal app. Over on ITSec.SE, I was helpfully shown a scheme to encrypt the third-party credentials based on a hash of the credentials for the internal app. I picked AES as the encryption algorithm, but the problem is that the password-b...
I'm implementing Shamir secret sharing in C using OpenSSL. I've split up the private key and i'm ready to start decrypting the original message using some of the shares. I set an "n" of 5 (5 shares total) and a "t" of 3 (3 shares required to decrypt). The way my encrypted message is stored is in a msg = (c1,...
I can't find any information on this and I really want to know. We discussed in class number theory and after making some proofs on division algorithms we made some modular arithmetic. It is my understanding that the definition of addition modulo 32 is: $a +_n b = (a + b) mod (n)$ So if I were to have for example 27 ad...
What exaclty is addition modulo 32 in cryptography?
What exactly is addition modulo 32 in cryptography?
EDIT: I've been confusing this the whole time. What I've been wanting to say this whole time is addition modulo $2^{32}$ not addition modulo 32 as the question originally said. Thanks for pointing that. ______________________________________________________________________________________ I can't find any information...
What exactly is addition modulo $2^{32}$ in cryptography?
The main problem is to use a block cipher to achieve randomness. I would like to generate 256-bits key which can be as random as possible. I generate it in the following way: 1. Pick a plaintext p0 of 64 bits and a 256-bit key k0. ( can be given from keyboard as seed) 2. Implement a cipher which goes from 64-bits ...
Let $P_i(x)$ be polynomials $i=1,...,n$, $s$ some value, and $g$ a generator of a group $G$ where the discrete logarithm is hard. Assume a prover wants to convince a verifier having access to the values $g^{P_i(s)}$ that it knows polynomials $q_i(x)$ such that the following equation holds: $q_1(s)*P_1(s)+q_2(s)*P...
Using pairings to verify an extended euclidean relation without leaking the values?
EDIT: I've been confusing this the whole time. What I've been wanting to say this whole time is addition modulo $2^{32}$ not addition modulo 32 as the question originally said. Thanks for pointing that. ___ I can't find any information on this and I really want to know. We discussed in class number theory and aft...
I'm implementing Shamir secret sharing in C using OpenSSL. I've split up the private key and I'm ready to start decrypting the original message using some of the shares. I set an "n" of 5 (5 shares total) and a "t" of 3 (3 shares required to decrypt). The way my encrypted message is stored is in a msg = (c1,...
The main problem is to use a block cipher to achieve randomness. I would like to generate 256-bits key which can be as random as possible. I generate it in the following way: 1. Pick a plaintext $p_0$ of 64 bits and a 256-bit key $k_0$. ( can be given from keyboard as seed) 2. Implement a cipher which goes from ...
I was wonder if I take the cipher text and make it numbers then multi it with random number will it be easy to count repeated letters or not. ex. GoldUnderSea num. 071512042114040518190501 x 911 Ctxt.65147470365890912071546411 and then will convert numbers to letters and to get the text again simply divide o...
I was wonder if I take the cipher text and make it numbers then multi it with random number, would frequency analysis still work? ex. GoldUnderSea num. 071512042114040518190501 x 911 Ctxt.65147470365890912071546411 and then will convert numbers to letters and to get the text again simply divide on / 911 ... ...
If I transform natural plaintext by: - making each letter two decimal digits, considering the whole as a decimal number; - multiplying by the key (and integer constant), giving the ciphertext; would frequency analysis still work? Exemple: Plaintext: G o l d U n d e r S e a Number: 071512...
Is frequency analysis a useful tool against encryption by multiplication?
If I transform natural plaintext by: - making each letter two decimal digits, considering the whole as a decimal number; - multiplying by the key (some integer constant), giving the ciphertext; would frequency analysis still work? Exemple: Plaintext: G o l d U n d e r S e a Number: 07151...
Asked and answered on server fault. http://serverfault.com/questions/51895/are-128-and-256bit-aes-encryption-considered-weak The follow-up sentence to your bold point though is: > And for new applications I suggest that people don't use AES-256. AES-128 provides more than enough security margin for the forseeab...
From a paper (via Schenier on Security's [Another AES Attack][1]) (emphasis mine): > In the case of AES-128, there is no known attack which is faster than the 2<sup>128</sup> complexity of exhaustive search. However, **AES-192 and AES-256 were recently shown to be breakable by attacks which require 2<sup>176</sup> a...
Is AES-256 weaker than 192 and 128 bit versions?
If your motivation is to rely on a DPA protected implementation of a block cipher, why don't you use one of the many hash function constructions based on a block cipher (think of Davies-Meyer for instance with say Rijndael at 256-bit plaintext)? Alternatively, the issue of using small input size compression function ...
If your motivation is to rely on a DPA protected implementation of a block cipher, why don't you use one of the many hash function constructions based on a block cipher (think of Davies-Meyer for instance with say Rijndael at 256-bit plaintext)? Alternatively, the issue of using small input size compression function ...
I am trying to build a public hash function (thus collision-resistant and preimage-resistant, and more generally behaving like a random oracle), with input a message $M$ of fixed size $|M|=m\cdot b$ bits, and output the hash $H(M)$ of fixed size $|H(M)|=h\cdot b$ bits, using as the single primitive a $b$-bit block ciph...
Asymmetric encryption and signing are entirely distinct concepts. The security and construction requirements are completely different. (Encryption for instance, needs to be an injection, whereas signature verification needs to be a surjection towards the verified message space). As a further hint of how they are intrin...
Asymmetric encryption and signing are entirely distinct concepts. The security and construction requirements are completely different. (Encryption for instance, needs to be an injection, whereas signature verification needs to be a surjection towards the verified message space. As a further hint of how they are intrins...
Recently a few papers have appeared that describe a new approach to factoring, using elliptic curves over $\mathbb{Q}$. See, e.g., * [Factoring integers and computing elliptic curve rational points](http://www.cs.usc.edu/research/06-875.pdf), Iftikhar A. Burhanuddin and Ming-Deh A. Huang. * [Factoring integers u...
The main problem is to use a block cipher to generate a random key. I would like to generate 256-bits key which can be as random as possible. I generate it in the following way: 1. Pick a plaintext $p_0$ of 64 bits and a 256-bit key $k_0$. ( can be given from keyboard as seed) 2. Implement a cipher which goes fr...
The main reason for designing a cryptographic hash function using a output transformation is flexibility. In the following a try to motivate the need for a output transformation. For example, SHA-256 has -- no output transformation and -- a fixed output size of 256-bit. What happen if you truncate a SHA-256 hash...
Can someone tell me how weak/storng this hand ciper?
In simple steps here the system: first write text. >hand cipher then divide into groups of three letters: >han dci phe r then choose a key consisting of three letters, for example `car` and encrypt first three letters with the key `han` + `car` => `kbf`. Then take the result `kbf` and encrypt the seco...
How weak/strong is this hand cipher?
Question: Are ciphertexts produced by secret (unknown to the public) algorithyms more secure than those produced by public algorithyms like AES? Answer: No. The reverse! Public algorithyms (like AES) have been examined by professional cryptographers all over the world. In contrast, secret algorithyms, by definition,...
[NIST Special Publication 800-57](http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57-Part1-revised2_Mar08-2007.pdf "Recommendation for Key Management – Part 1: General (Revised)") defines a cryptoperiod as >the time span during which a specific key is authorized for use by legitimate entities, or the keys for...
The main reason for designing a cryptographic hash function using an output transformation is flexibility. In the following, I try to motivate the need for an output transformation. For example, SHA-256 has no output transformation and a fixed output size of 256-bit. What happens if you truncate a SHA-256 hash ...
The Enigma algorithm is a encryption method that was developed (I believe) by the Germans in WWII. [It went a little something like this][1]: > When a letter was typed on the keyboard of the Enigma machine, it was first sent through the first rotor, which would shift the letter according to its present setting. The ...
This is all about the question of risk assessment. Are you willing to risk all devices together so that if one key is compromised, they all have to be returned? What is the cost of one return, 100 returns, or 100,000 returns? What is the expense of issuing a master key? Of issuing ten master keys? Of issuing a tho...
I have a file, which was encrypted with AES-128 in ECB mode. I know the format of the original file and know that all files in this format have the same headers. So, I have an encrypted block and the original block. Can I get the encryption key, using this information?
Is it possible to obtain AES-128 key from a known ciphertext-plaintext pair?
When is each key used when encrypting an email using OpenPGP?
Question: Are ciphertexts produced by secret (unknown to the public) algorithms more secure than those produced by public algorithms like AES? Answer: No. The reverse! Public algorithms (like AES) have been examined by professional cryptographers all over the world. In contrast, secret algorithms, by definition, hav...
[Blum-Blum-Shub](https://en.wikipedia.org/wiki/Blum_blum_shub) is a stream cipher: given a short key, it produces an effectively unlimited-length stream of pseudorandom bits. Other well-known examples of stream ciphers include AES-CTR and RC4. Blum-Blum-Shub gets mentioned a lot by non-expert cryptographers. I sus...
I have the following definition: An (efficient secret-key) encryption scheme (Gen,Enc,Dec), where Gen and Enc are PPT algorithms and Dec is a Deterministic Polytime Algorithm, is one-time computationally-secret if for any PPT adversary A it holds that the probability of the following experiment is negligibly biased ...
Why is a non fixed-length encryption scheme worse than a fixed-length one?
I'd like to combine a random key file with a password to generate a secure seed for a CSPRNG. The key file is assumed to have very high entropy, but the password will be whatever the user provides. What's the best way to combine the two in order to seed the PRNG? The goal of course is that the output of the PRNG will b...
The encryption scheme in the experiment you describe does not have to be fixed-length. We simply require that the two messages the adversary sends to its oracle have the same length. The restriction is on the adversary, not on the encryption algorithm. So why do we put this requirement on the adversary? The reason i...
Let $p$ be a large prime; we will work in $GF(p)$. Let $A$ be a $n\times n$ matrix. Also, let $x$ be a $n$-vector and $k$ a positive integer. Suppose we are given $p$, $A$, $x$, and $y$. The goal is to find a $k$ that satisfies $A^k x = y$. Is there an efficient algorithm that solves this problem? You can assum...
I have the following definition (highlights by me): > An (efficient secret-key) encryption scheme $(Gen,Enc,Dec)$, where $Gen$ and $Enc$ are PPT algorithms and $Dec$ is a Deterministic Polytime Algorithm, is *one-time computationally-secret* if for any PPT adversary $A$ it holds that the probability of the following...
I'd like to combine a random key file with a password to generate a secure seed for a CSPRNG. The key file is assumed to have very high entropy, but the password will be whatever the user provides. What's the best way to combine the two in order to seed the PRNG? The goal of course is that the output of the PRNG will b...
I'm looking into encrypting files like this: First, I SHA-1 hash the password. Let's say the password is something normal like "hello123", and then hashed. Then I encrypt a file using this: openssl aes-256-cbc -a -salt -in file -out file.enc (using the hash for the password). So it's basically just an AES-...
How easily could this be cracked?
It's really just the sum of the time it takes to execute both algorithms on that "normal" hardware. If you can test 100,000 SHA-1 iterations per second on the machine, and 50,000 AES256 decryptions per second, .00001 + .00002 = .00003, or 33,333 tests per second. But there's a lot you didn't answer. How much keysp...
Lets say I want to build a simple chat program that has encryption that is impossible to crack for anyone, even a theoretical government with a massive super computer. Ok here's my idea. You'll need to read all the points to get the whole picture I think. - Only two people can communicate with each other with the c...
Would this simple encrypted chat program be feasible using One Time Pads?
If i have a group $\mathcal{G}$ of order a prime $N=npq$ and subgroups $\mathcal{G_n,G_p,G_q}$ of order $n,p,g$ respectively and if $g$ is a generator of $\mathcal{G}$ why then $g^{nq}$ is a generator of $\mathcal{G_p}$, $g^{np}$ is a generator of $\mathcal{G_q}$ and $g^{pq}$ is a generator of $\mathcal{G_n}$ ?
I am doing some research on cryptography, so I generated a random string of numbers resembling a creditcard number(according to MOD10 validation) and encrypted it with SHA1 algorithm for encryption. But to make this interesting, I decided to make my database column size exactly 2/3 smaller than the encrypted text so th...
The practice you describe is acceptable and secure. As long as the cryptographic PRNGs have no weaknesses, and as long as you use a seed of sufficient size, this is safe. Whether it is desirable is a separate question. Do you really have a valid reason why you need to do this? If not, it's just adding unnecessary...
In simple steps here the system: first write text. >hand cipher then divide into groups of three letters: >han dci phe r then choose a key consisting of three letters, for example `car` and encrypt first three letters with the key `han` + `car` => `kbf`. Then take the result `kbf` and encrypt the seco...
How weak/strong is this hand cipher? (updated)
In simple steps here the system: first write text. >hand cipher then divide into groups of three letters: >han dci phe r then choose a key consisting of three letters, for example `car` and encrypt first three letters with the key `han` + `car` => `kbf`. Then take the result `kbf` and encrypt the seco...
The practice you describe is acceptable and secure. As long as *each* of the cryptographic PRNGs has no weaknesses *and* you use a seed of sufficient size, this is safe. Whether it is desirable is a separate question. Do you really have a valid reason why you need to do this? If not, it's just adding unnecessary ...
In simple steps here the system: first write text. >hand cipher then divide into groups of three letters: >han dci phe r then choose a key consisting of three letters, for example `car` and encrypt first three letters with the key `han` + `car` => `kbf`. Then take the result `kbf` and encrypt the seco...
First off, hashing is not encryption. Those are two very different concepts. You should read those links, they'll help you understand: * [Encryption](http://en.wikipedia.org/wiki/Encryption) * [Hash function](http://en.wikipedia.org/wiki/Cryptographic_hash_function) As for your original question: *What happens t...
Is there a way to decrypt a AES cipher Text which was encrypted twice with some key, when having a part of this key? (the last 3 bytes of the key are missing)
If I have a group $\mathcal{G}$ of order $N=npq$ and subgroups $\mathcal{G_n,G_p,G_q}$ of order $n$, $p$, $g$ respectively and if $g$ is a generator of $\mathcal{G}$ why then $g^{nq}$ is a generator of $\mathcal{G_p}$, $g^{np}$ is a generator of $\mathcal{G_q}$ and $g^{pq}$ is a generator of $\mathcal{G_n}$ ?
I think I roughly understand how the RSA alorithm is working. However, I don't understand why we need the $N$, which we use as a modulus, to be $pq$ for some large primes $p, q$. I vaguely know it has something to do with factorization, but I am kind of lost. So, hypothetical questions. - What would happen if ...
Why do we need in RSA the modulus to be product of 2 primes?
I found a simple algorithm for factoring semiprime numbers, you can read about it here: http://rainbowofprimes.com/JoaodaSilva/Joao_da_Silva-IEEE-2010-paper2.pdf It basically works like this: -You reverse the digits in N, let's call this value 'rN' -You pick an integer, k (normally 1, but can be other values...
Is there an algorithm for factoring N, which is just as simple as this one, but faster?
I found a simple algorithm for factoring semiprime numbers, you can read about it in [Factoring Semiprimes and Possible Implications for RSA](http://rainbowofprimes.com/JoaodaSilva/Joao_da_Silva-IEEE-2010-paper2.pdf). It basically works like this: - You reverse the digits in $N$, let's call this value $Ň$ - Yo...
I'm implementing Shamir secret sharing in C using OpenSSL. I've split up the private key and I'm ready to start decrypting the original message using some of the shares. I set $n = 5$ (5 shares total) and $t = 3$ (3 shares required to decrypt). The way my encrypted message is stored is in a ${\rm msg} = (c_1...
I'm implementing Shamir secret sharing in C using OpenSSL. I've split up the private key and I'm ready to start decrypting the original message using some of the shares. I set $n = 5$ (5 shares total) and $t = 3$ (3 shares required to decrypt). The way my encrypted message is stored is in a ${\rm msg} = (c_1...
I'm implementing Shamir secret sharing in C using OpenSSL. I've split up the private key and I'm ready to start decrypting the original message using some of the shares. I set $n = 5$ (5 shares total) and $t = 3$ (3 shares required to decrypt). The way my encrypted message is stored is in a ${\rm msg} = (c_1...
Assume you chain random number generators, i.e use the result of one PRNG as the seed for the next. What kind of errors can that introduce in the randomness of the numbers generated?
Does chaining random number generators leads to loss of randomness?
The **[Password-Based Key Derivation Function 2](http://en.wikipedia.org/wiki/PBKDF2)** (PBKDF2) is a method of securely deriving encryption keys from a passphrase entered by a user. PBKDF2 was published by RSA Laboratories as part of the [PKCS #5](http://www.rsa.com/rsalabs/node.asp?id=2127) v2.0 standard (also pub...
I'm looking at a square attack against a reduced version of AES-128 with only 4 rounds (with block and key size of each 128 bit). I have a set of 256 plaintext-ciphertext block pairs. What is the complexity of the computations, in number of encryptions, partial encryptions, memory usage, and data requested?
What is the complexity of the Square attack against the reduced 4-rounds 128-bit Rijndael variant?
I'm preparing myself to exam, but I have a lot of troubles with rigorous proofs. Let $\Pi=(Gen,Enc,Dec)$ be an efficient secret-key encryption scheme that is not fixed-length. That is, for any $n$ and any $k \leftarrow Gen(1^n)$ the encryption algorithm $Enc_k(\cdot)$ can encrypt arbitrary length messages $m \in \lb...
I'm preparing myself to exam, but I have a lot of troubles with rigorous proofs. Let $\Pi=(Gen,Enc,Dec)$ be an efficient secret-key encryption scheme that is not fixed-length. That is, for any $n$ and any $k \leftarrow Gen(1^n)$ the encryption algorithm $Enc_k(\cdot)$ can encrypt arbitrary length messages $m \in \lb...
I'm preparing myself to exam, but I have a lot of troubles with rigorous proofs. This post is very long, but this is because I remind here 2 long definitions. --- At the beginning I want to remind the definicion of CBC-MAC. Let $F$ be a pseudo-random function. We define the CBC-MAC as $(Gen,Mac,Vrfy)$ as follo...
I'm a little bit confused by your notation (what's $1^n$ supposed to mean? based on context, it looks like a key or a passphrase, but I've never seen that notation before), but the exercise itself seems to just amount to proving that a MAC-then-Encrypt scheme, using a deterministic MAC sent in plain, cannot be IND-CPA ...
i'm trying to figure out when an [**Intialization Vector**](http://en.wikipedia.org/wiki/Initialization_vector) (IV) should be used. There are anecdotal reports that WEP was broken [because of weak IV's](http://en.wikipedia.org/wiki/Wired_Equivalent_Privacy#Flaws). It's also claimed that if two pieces of plaintext ...
Why, or when, to use an Initialization Vector?
Why is an Encrypt-and-MAC scheme with deterministic MAC not IND-CPA secure?
Perfect secrecy, in the simplest terms, is data that is completely, entirely patternless. Yet, inside of it there is still your secret. ArtofTheProblem offers a good simple explanation. http://www.youtube.com/watch?v=cAt6MYoGqJ4
I'm preparing myself to exam, but I have a lot of troubles with rigorous proofs. This post is very long, but this is because I remind here 2 long definitions. > At the beginning I want to remind the definicion of CBC-MAC. > > Let $F$ be a pseudo-random function. We define the CBC-MAC as $(Gen,Mac,Vrfy)$ as foll...