instruction
stringlengths
15
30k
What's wrong with MARS?
Salsa20 has strong rotational symmetry. The main point of these constant is that they're not invariant under rotations, introducing an asymmetry. The precise value isn't very important, as long as it's sufficiently asymmetric. [Bernstein - Salsa20 security](http://cr.yp.to/snuffle/security.pdf) says: > **Notes on...
Why did the MARS cipher receive such a high number of negative votes in the AES competition? As I understand only MARS and Serpent implement measures to counter future cryptoanalytic attacks, so it would seem that it is one of the most secure ciphers in the competition. Am I missing something?
Alice and Bob are going to follow the protocol below. Are there any crypto-constructions to help Bob verify the correctness of the answer he gets?: 1. Alice encrypts a set of numbers using some cryptosystem and a secret key (e.g. Paillier crypto-system). 2. Bob multiplies the ciphertexts to obtain an encryption of...
I'm looking at Secp 256K1 vs UProve's FIPS 186-3 or P-256 implementation. Is there any relationship between the curves such that I can consistently "map" or "project" values from one curve to another? Is this a good idea? (What faults could crop up when doing so?) My goal is to allow for two independent crypto ...
Can Secp 256 K1 curves "map" to a value on FIPS 186-3 or P-256?
It is a little unclear, how you transformed all your numbers... e.g. how did you interpret your decimal numbers "as binary" and "create a bitmap"? Then you look at the binary representation and guess what.... and they are just the numbers 0-9 in binary and added on an static number (no idea where that came from). Th...
It is a little unclear, how you transformed all your numbers... e.g. how did you interpret your decimal numbers "as binary" and "create a bitmap"? Then you look at the binary representation and guess what.... and they are just the numbers 0-9 in binary and added on an static number (no idea where that came from). Th...
Security considerations on "expand 32-byte k"-magic number in the Salsa20 famility of stream ciphers?
What block cipher is used for CBC-MAC? DES, AES, 3DES? Or it doesn't matter?
What block cipher is used for CBC-MAC?
Suppose Alice seeds a cryptographically strong Pseudo Random Number Generator with a truly random number, and keeps it secret. Alice then uses the output of the PRNG to generate several 256-bit numbers in sequence. Each of those 256-bit numbers is then used as an ECDSA private key, public keys are generated from them, ...
I'm testing an implementation of Bitcoin, which uses the curve Secp256k1 for ECDSA, and I want to see how it handles the point at infinity ($0$) if present in a signature. For example, r could be the x coordinate of the encoding of the point at infinity. How is the $0$ encoded? Can it be encoded? I found that bo...
i am creating some primitive demostration for ECDSA over small curve (p < 229). But my implementation have some weird issues. Verify process return false even if the signature is correct. Because I am testing it for some time, trying to find problem I discovered that verify work only if point order is prime. So my ...
I recently discovered the Curve25519 key exchange lib and the Ed25519 signature lib. Due to the speculations about NIST-designed curves, there is a chance that I ditch them and use the curves above instead. If I take the curve parameters from these two libs and use them in ECDH/ECIES and ECDSA respectively, will it ...
I'm currently working on an application that requires me to add two ECDSA private keys in order to make a new private key. The result has to have the property, that its corresponding public key is the same as one would sum the public keys corresponding to the first private keys. I managed to get most of that going, ...
Consider the One-Time Pad (OTP). Suppose two parties, *A* and *B*, generate a completely random secret key in a real-life meeting, and they keep this secret. Now *A* wants to send some message to *B* using the OTP. The point is that in the OTP we can use any key only once. So we have to come up with a system to share a...
Is there any technique so that if I encrypt data, the ciphertext would be genuine and if someone else tries to encrypt the same data the ciphertext could be determined as fake or just invalid? I want to create a network in which the user has to register to get a ciphertext(like a token) and only after getting a genu...
If you want to store the OTP for MsgB in MsgA then the new length of `MsgA = Len(MsgA) + Len(OTP)`. As Ricky Demer pointed out the pad must be at least as long as the message so the new length is in effect = `Len(MsgA) + Len(MsgB)`. So why not just arrange a OTP of Length = `Len(MsgA) + Len(MsgB)` and divide it up ...
Is there any technique so that if I encrypt data, the ciphertext would be genuine and if someone else tries to encrypt the same data the ciphertext could be determined as fake or just invalid? I want to create a network in which the user has to register to get a ciphertext (like a token) and only after getting a gen...
Geniune encryption from only one source?
I a have a question about PRNGs and this is my very first experience with them. I have the following generator that takes a 56-bit seed $p$ during initialization and then chooses both $X$ and $Y$ randomly from the interval $[0, p]$. Every time it is called, it returns the output of the next function: def next...
Do I need to worry about "predictability" an an allegedly secure CSPRNG if I am just using it to generate key material from time to time? Suppose that for some odd reason, I am less trustful today than I was last week of `SecRandomCopyBytes()` in OS X and iOS and of `CryptGenRandom()` in Windows. If I am using this ...
i want to generate random number for example from [1..100]. The algorithm which would generates random number should work similarly like a *"Linear congruential generator"*, like this: $X_{n+1}≡(aX_n + c)\ (mod\ m)$ Where: $c$ - increment should be something like 98979817 $a$ - should be used for security ...
I am working on a project where I am benchmarking the 5 AES finalists (Rijndael, Twofish, Serpent, MARS and RC6) on CUDA Hardware. My problem is that I am no experienced CUDA programmer. My approach is to find open source projects that implement these algorithms in CUDA and modify them to match my needs. It was o...
Is there any technique so that if I encrypt data, the ciphertext would be genuine and if someone else tries to encrypt the same data the ciphertext could be determined as fake or just invalid? I want to create a network in which the user has to register to get a ciphertext (like a token) and only after getting a gen...
I thought the current state of the are wrt. FHE was Brakerski, Gentry and Vaikuntanathan's scheme (BGV) based on standard/ring LWE employing modulus switching for noise management. I recently came across a paper by Zvika Brakerski on a "scale invariant" FHE scheme, based on gapSVP, that does not require modulus s...
I am working on a project where I am benchmarking the 5 AES finalists (Rijndael, Twofish, Serpent, MARS and RC6) on CUDA Hardware. My problem is that I am no experienced CUDA programmer. My approach is to find open source projects that implement these algorithms in CUDA and modify them to match my needs. It was o...
I thought the current state of the art wrt. FHE was Brakerski, Gentry and Vaikuntanathan's scheme (BGV) based on standard/ring LWE employing modulus switching for noise management. I recently came across a paper by Zvika Brakerski on a "scale invariant" FHE scheme, based on gapSVP, that does not require modulus swi...
**Preamble:** There is currently a zoo of various logics for evaluating (proving) security in cryptographic protocols. The idea is that, by expressing these protocols using some logic, you can create a formula describing some property (such as shared secrecy, message authentication, and perfect forward secrecy). ...
Genuine encryption from only one source?
I'm conducting an experiment dealing with differences in padding across different aes operations for my Intro to Crypto class, and the question says OpenSSL uses PKCS5 padding, and that I need to prove this. All we've been taught up to this point was how to encrypt something by doing this: openssl enc -aes-128-c...
This is a program that I made for encrypting text files. It uses a one time pad cipher to encrypt the files, but I do not know if there is any holes in my program that could be a vulnerability. Is my one time pad cipher secure? import os q = 1 while q == 1: e = raw_input("file to encypt: ") ...
How do I choose the best 3*3 s-boxes?
So for a Diffie-Hellman problem, I am given the prime $p$ for the Diffie-Hellman exchange. I am also given $g$, secret number for machine as $A$, secret number for station as $B$, a Diffie-Hellman shielded Login Name $V$, and Diffie-Hellman shielded password $W$. For this problem, I am am given three users and see ...
So for a Diffie-Hellman problem, I am given the prime $p$ for the Diffie-Hellman exchange. I am also given $g$, secret number for machine as $A$, secret number for station as $B$, a Diffie-Hellman shielded Login Name $V$, and Diffie-Hellman shielded password $W$. For this problem, I am am given three users and see ...
The Wikipedia article "[One-time pad ~ Authentication](http://en.wikipedia.org/wiki/One-time_pad#Authentication)" says : > For example, an attacker who knows that the message contains "meet jane and me tomorrow at three thirty pm" at a particular point can replace that content by any other content of exactly the sam...
It works with modular-arithmetic-based one-time pads as well. If somehow we know this part of a ciphertext… HZIVQ JJGTY GKBSI IWMVV HIYTA YHHDV XLBOK O …we can decrypt it to this message… MEETJ ANEAN DMETO MORRO WATTH REETH IRTYP M Then the key would have to be this: UUDBG IVBSK CXWYT VHUD...
Given that RSA key generation works by computing: - n = pq - φ = (p-1)(q-1) - d = (1/e) mod φ If I was an attacker who wanted to brute force d, could I brute force d given just the public key and the generally known facts of RSA such as * φ is always less than n = pq * n is known by the attacker by the ...
How difficult is it to brute force d in RSA: d = (1/e) mod φ in a KPT attack?
Given that RSA key generation works by computing: - n = pq - φ = (p-1)(q-1) - d = (1/e) mod φ If I was an attacker who wanted to brute force d, could I brute force d given just the public key, the plaintext message, and the generally known facts of RSA such as * φ is always less than n = pq * n is known...
Given that RSA key generation works by computing: - n = pq - φ = (p-1)(q-1) - d = (1/e) mod φ If I was an attacker who wanted to brute force d, could I brute force d given just the public key, the plaintext message, and the generally known facts of RSA such as * φ is always less than n = pq * n is known...
Given that RSA key generation works by computing: - n = pq - φ = (p-1)(q-1) - d = (1/e) mod φ If I was an attacker who wanted to brute force d, could I brute force d given just the public key, the plaintext message, and the generally known facts of RSA such as * φ is always less than n = pq * n is known...
>How can I calculate or estimate the difficulty of attacking d when only the public key is known? (no optimizations) Generate a few hundred pairs $(n,\varphi(n))$ for whatever key size you are interested in, then compute the average distance between the pairs. That would give you a guess as to how many values on av...
<p> Crypto Stack Exchange is for software developers, mathematicians and others interested in cryptography. </p> <p>Cryptography Stack Exchange is for asking questions about the mathematics and properties of cryptographic systems, their analysis ("cryptanalysis") and subsidiary topics that generally make up crypto...
What topics can I ask about here?
Camellia cipher - is it a symmetric or asymmetric cipher?
I'm looking to implement Lamport signatures as a little fun project, and I need a _fast_ one way function that maps $\{0,1\}^{256} \rightarrow \{0,1\}^{256}$. I was wondering whether I could safely use the ChaCha core for that, by setting the input as the key, the nonce and counter to 0 and truncating the output to ...
Can I use the ChaCha core as a 256-bit to 256-bit one-way function?
I have the need for a hexadecimal token that is smaller than the normal length of the hexadecimal representation of a [SHA-256](http://en.wikipedia.org/wiki/SHA-256) hash. Should I take the first bits or the last bits? Which of them contain the most entropy?
Should I use the first or last bits from a SHA-256 hash?
Is it possible to identify the encryption method, or at least rule out some of them, by looking at the encrypted text? For example, if you have 3 encrypted strings where the first 10 characters are the same on each of the strings.
Is it possible to derive the encryption method from encrypted text?
How difficult is it to brute force d in RSA: d = (1/e) mod φ in a CPT attack?
According to wikipedia… > DES is now considered to be insecure for many applications However, since it can be broken relatively easy, should it not just be avoided for all applications?
I was looking at [FOAF+SSL](http://www.w3.org/wiki/Foaf+ssl) and wondering if its possible to spoof the modulus of the browser certificate so that the FOAF and browser certificate's modulus match?
Is it possible to spoof an identity cert modulus?
Is it possible to deduce the original function that used to generate those prepaid cards number that are used for charging your mobile phone credits? For example: If I've collected about 1000 of those cards, how can I analyze those numbers so that I can re-generate the generated numbers again using my own software?
Can Pre-Paid Cards be cracked?
This is a lossy algorithm. You will lose information during the translation and reverse-translation steps. Introducing loss into any algorithm obviously increases the difficulty in pulling the clean plaintext out, since it's potentially impossible to pull the clean plaintext out even with the key. Even so, fairly no...
How much harder is it to determine the secret key for a mono-alphabetic substitution cipher, if each word is translated into a different language before the cipher is applied? If somehow computers could create their own language or set of languages such that there is a one-to-one correspondence between words and the...
I do not really understand the meaning of a "trapdoor" in cryptography, so here are my questions: - What is the meaning of trapdoor and how can I convert a word or string using a trapdoor in cryptography? - Is a hash function considered to be a trapdoor function, or is a trapdoor function some kind of encryption? ...
What is the meaning of "trapdoor" in cryptography?
If we define Oblivious Transfer as following: Alice inputs $(x_0,x_1) \in F^2$, where $F$ is a field, and Bob inputs $b\in\{0,1\}$, then Alice gets a dummy output(for which she knows nothing about b), and Bob gets $x_b$. Now if we use a Random functionality R, which requires no input but output random bits $(z_0,z_1...
Protocol for Randomized Oblivious Transfer?
In page 9 (16 in the PDF) of [Final report][1] of [European project IST-1999-12324 (NESSIE)][2], it is mentioned that: > The NESSIE project is also developing a new generic tool to analyze block ciphers with differential [78] and linear cryptanalysis [422]. **This tool is based on a general description language fo...
Is there any general description language for block ciphers?
Are there asymmetric cryptographic algorithms that are not based on integer factorization and discrete logarithm?
Can I select a large random prime using this procedure?
I am attempting to determine the strength of an incorrectly implemented 1024 bit RSA signature scheme. The weakness in the implementation is that the padding data lacks random numbers. As a result, for every message signed, only 160 bits of data are changed (cryptographic hash). How does one determine the resulting ...
What is the key strength reduction encrypting only 160 bits of data using RSA1024 for signatures?
I am wondering what length the padding should be when encrypting or signing with RSA. Does it matter what length the padding is, and if so — what length should it be? Another point: Should it be random?
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.getB...
How can I convert a DER ECDSA signature to ASN.1?
I'm a beginner to cryptography and looking to understand in very simple terms what a cryptographic *"salt"* is, when I might need to use it, and why I should or should not use it. Can anyone offer me a very simple and clear (beginner level) explanation please? If you know of any references on the topic, those would ...
Can you help me understand what a cryptographic "salt" is?
I want to know the basic understanding of ECC algorithm for cryptography. But I am not aware of the algorithm. Can anyone provide me with a basic explanation of the algorithm?
Can you help me understand ECC Cryptography and it's algorithm?
By someone's suggestion, I am posting this question from [math.stackexchange.com](http://math.stackexchange.com/). I want to find out a suitable function or algorithm, which can provide a random sequence like this… Input: $3$ Output: $\{1,2,3\}$ or $\{1,3,2\}$ or $\{2,1,3\}$ or $\{2,3,1\}$ or $\{3,1,3\}$ or $\...
Can you help me with this Random Number Generator function?
This mode is that each time a random number $K$ is generated, you *XOR* it with plaintext $M$ and then pass the result to AES. Since AES is a pseudo random permutation, does AES have the following property? $$AES(M \oplus K) = AES(M) \oplus AES(K)$$
Does AES with whitening mode have the following property?
First up: it's a step in some challenge found on the Internet, where we get an application and a file. The application must be feed with that file and a password (the password is the flag for the challenge). So, after reversing the application, I found that the algorithm used is RC4 with a small change in the "S" ar...
Can I safely replace XOR with ADD in a stream cipher?
I am aware of the vulnerabilities of simple xor ciphers and recently I came across a block cipher that claims to solve those vulnerabilities. The cipher goes as follows with both the block and key sizes at 256-bits: the key is separated into chunks of length 1 bit. Every bit in the plaintext is xored with every key...
Is this "layered" XOR cipher secure?
For primes p and q used to create a keypair, I understand that the following operation is used to create a signature: $M^d (\bmod\ N)$ where d and N have their usual meanings and M is the message. In this case, however you need to possess the public key in order to verify the signature S as follows :- $S^e (\b...
I started reading about the most recent cryptanalysis of RC4 and it's variants. One of the papers I just finished reading (["Two Linear Distinguishing Attacks on VMPC and RC4A and Weakness of RC4 Family of Stream Ciphers" by Alexander Maximov](http://eprint.iacr.org/2007/070.pdf)) handles Linear Distinguishing Attacks....
How much does a successful Distinguishing Attack "break" the attacked stream cipher?
I'm aware of two methods to attack RSA: 1. Brute force factoring, where no plain text is available 2. Brute force (1/e) mod φ where the plain text is available [as described here][1] **Question** * Given an optimized solution either in a generic CPU, or custom ASIC, what operation is more likely to take lo...
In RSA, what is faster attacking "d" when plaintext is known, or factoring when M is unknown?
Is it a multi-disciplinary, inter-disciplinary, cross-disciplinary, or maybe even trans-disciplinary? What are the basis to describe each kind? I mean, how can we infer by which disciplinary field we can describe the cryptography? I got an answer saying that it is multi-disciplinary because it contains multiple sub...
In which disciplinary category can cryptography be put?
Brainwallet is a program that takes a passphrase (hopefully a good one) and deterministically creates a Bitcoin wallet. This wallet can be used for transactions, then deleted from the computer. To get access to the wallet again, one only needs the passphrase to recreate it. This makes me wonder; does something simil...
Is there a "brainwallet" for GPG keys?
The definition of $e$ can be seen [here][1].I want to know the accurate comparison of efficiency between $e(,)$ and $g^a \pmod{p}$. If the efficiency of computing $e(P,Q)$ is slower than $g^a \pmod{p}$ , then whether that means we should prefer $g^a \pmod{p}$ to $e(P,Q)$ in the designing of protocols? And another,w...
Efficiency of computing $e(P,Q)$ Vs $g^a \pmod{p}$?
The definition of $e$ can be seen [here][1]. I want to know the accurate comparison of efficiency between $e(\cdot,\cdot)$ and $g^a \pmod{p}$. If computing $e(P,Q)$ is less efficient than computing $g^a \pmod{p}$, should we prefer $g^a \pmod{p}$ to $e(P,Q)$ when designing protocols? Also, what is the reason for def...
Are there open source implementations of SSE and OPE? Can anyone please point to sample codes, if available.
Firstly, there is not _one_ definition of a pairing. _A_ pairing is a bilinear function: you have three finite groups $G_1$, $G_2$ and $G_3$; a pairing is a function $e$ such that, for all $(g_1,g_2) \in G_1\times G_2$ and all integers $a$ and $b$, then $e(g_1^a,g_2^b) =e(g_1,g_2)^{ab}$ (I am here using multiplicati...