instruction
stringlengths
15
30k
Can I use a one time pad key twice with random plaintext?
My question might appear the same as the question [Taking advantage of one-time pad key reuse?][1], but actually I did read all the answers and none of them helped me with the details I need. I am new to cryptography and my problem is with two time pad attacks on OTP. The problem I had in my course was that I have ...
How does one attack a two-time pad (i.e. one time pad with key reuse)?
Ok. So, I now know the basic differences between them. But I'd love to know the deeper things, like: EXACTLY WHY IS THE ASYMMETRIC APPROACH SLOWER THAN THE SYMMETRIC; AND WHY DOES IT MAKE USE OF LONGER KEYS; WHY DOES IT REQUIRE MORE PROCESSING POWER, etc, etc. AND IN WHAT WAYS DOES IT TRUMP THE SYMMETRIC APPROACH? ...
Ok. So, I now know the basic differences between them. But I'd love to know the deeper things, like: 1. Exactly why is the asymmetric approach slower than the symmetric? 2. Why does it make use of longer keys? 3. Why does it require more processing power, etc, etc? 4. In what ways does it trump the symmetr...
>Background: >I've been thinking about using encryption in the context of backing up files to >untrusted locations (to the point of making the file publicly and widely >distributed for practically failsafe backup). > >The problem is, once a file is publicly available, it will forever remain so. And >in 20 years, whe...
>Background: > I've been thinking about using encryption in the context of backing up files to untrusted locations (to the point of making the file publicly and widely distributed for practically failsafe backup). > >The problem is, once a file is publicly available, it will forever remain so. And in 20 years, when...
After some more thought, the answer is "yes", you can construct a hash from a stream cipher. (My other answer from a few days ago was only negative, eg, how *not* to construct it.) Here is a construction. First build a block cipher $B$ from the stream cipher $S$: * Take the PRG $P$ from $S$. * You can build a ...
After some more thought, the answer is "yes", you can construct a hash from a stream cipher. (My other answer from a few days ago was only negative, eg, how *not* to construct it.) Here is a construction. First build a block cipher $B$ from the stream cipher $S$: * Take the PRG $P$ from $S$. * You can build a ...
The scenario is single-use passphrase-based non-interactive message authentication. <br> The obvious try to do this is to chose a random salt of the appropriate length and send concat(workfactor,salt,message,mac(scrypt(workfactor,salt,passphrase),message)) . <br> That protocol is as secure as scrypt is a non-mallea...
Is there any known malleability of scrypt outputs?
Does anyone know of any sites where intermediate values of multiple crypto algorithms (not just the famous ones), including hashes, can be found? I don't just mean intermediate values of encrypting. I'm also looking for intermediate values of the key generation algorithms as well. Hopefully, the initial values can be c...
Is anyone able to point me towards a known-to-be-good diffie-hellman group? I currently use group 24 (RFC5114, 2048-bit MODP Group with 256-bit Prime Order Subgroup). It came to me that this group is not adequate even for AES-128 (this is according to www.cryptopp.com/wiki/Diffie-Hellman)...so far it seems my only opti...
IV is called an initialization vector because it is the first vector. The next vectors are the cipher text blocks. And guess what: all of them are send in plain. So what again are you trying to achieve by simply encrypting the very first one? Answer only valid for particular blockcipher encryption modes (most import...
The initialization vector (IV) is exclusive or'd against the plain text before encryption for the first block sent in order to prevent an attacker from learning that duplicate message blocks are being sent. This technique is often used with streaming modes like CBC. I have researched some of the questions that were...
Why is the IV passed in the clear when it can be easily encrypted?
I was wondering, whether there exist such algorithms/enciphering procedures which both compress and encrypt the input data. That means, for starters, the output will be both smaller in size and difficult to decrypt...and if the compression algo is good, then the bits will be almost random. Also any twin-encryption ...
Crypto-Compression Algorithms?
> Also any twin-encryption algo-s around?: by which I mean, suppose I have 2 data strings (alphanumeric only, say for now) -- Using them both, and an algo, I produce the encrypted output - I take in a pair, and produce a pair. The procedure is algo-based and not key-based. One fundamental fact (or perhaps I should s...
One use of an anti-forgery token is to [prevent Cross-Site Request Forgery (CSRF) attacks][1]. The attacker doesn't need to sniff the wire in order to carry out a CSRF attack. This attack relays on the fact that the HTTP request is predictable, and the defense is to add a secret value such that an attacker cannot f...
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(self)...
I have a very basic doubt in RSA key generation and its usage. In RSA key generation you choose two large prime numbers of a very large order. Then you multiply them.(eq p * q = N) Now, Euler(N)=(p-1)(q-1). Now you find a number 0 < e < Euler(N) such that e and Euler(N) are coprime. {e.Euler(N)} becomes your public ...
I have a very basic doubt in RSA key generation and its usage. In RSA key generation you choose two large prime numbers of a very large order. Then you multiply them.(eq $p \cdot q = N$) Now, $\phi(N)=(p-1)(q-1)$. Now you find a number $0 < e < \phi(N)$ such that $e$ and $\phi(N)$ are coprime. {$e,N$} becomes your p...
I'm using twofish. Say you have a 120 bit key, is there any difference in using a 128 bit bit keylength or a 256 bit one? Since the most significant digits of the key will be allo zero in both cases, does the keylen parameter really matter?
Can I uses guids / uuids as counters for key derivation?
In the [1978 RSA paper][1], it is recommended, among other things, to choose primes $p$ such that $(p-1)$ has a large prime factor $u$. This was motivated by [Pollar's p-1 algorithm][2]. Further, the authors state: > Additional security is provided by ensuring that $(u−1)$ also has a large prime factor. What was ...
In RSA, rationale for prime p with p-1 having prime factor u with u-1 having large prime factor?
In the [1978 RSA paper][1], it is recommended, among other things, to choose primes $p$ such that $(p-1)$ has a large prime factor $u$. This was motivated by [Pollard's p-1 algorithm][2]. Further, the authors state: > Additional security is provided by ensuring that $(u−1)$ also has a large prime factor. What was...
In RSA, rationale for prime $p$ with $p-1$ having prime factor $u$ with $u-1$ having large prime factor?
What is the best [CPA distinguisher][1] for the function $F_k:\{0,1\}^{8n}\to\{0,1\}^{16n}$ described below? Let $E_k$ be a $2n\times2n$ matrix with elements in $GF(2^8)$, selected by generating bit strings of length $32n^2$ using a predefined function $PRF_k$, until one is found that is invertible e.g. using [Gauss...
I am trying to learn more about GCM mode and how it differs between CBC. I already know that GCM provides a MAC which is used for message authentication. From what I have read, and seen code snippets of is that GCM does an exlusive or much like CBC, but I'm not sure what the exclusive-or is against. In CBC mode, the...
What is the difference between CBC and GCM mode?
Can I use guids / uuids as counters for key derivation?
If i use the cipher output from an algorithm and encrypt it again with the same algorithm, i been read somewhere that the output in the second use will be weaker the the output from the first one, how come that is true?
If I use the output of a cipher, for example a block cipher such as AES and encrypt it again with the same algorithm, I read that this introduces weaknesses into the overall security of the system. Is this the case?
Does encrypting twice using the same algorithm produce a security weakness?
Does encrypting twice using the same block cipher produce a security weakness?
I am wondering if AES only supports 64 character passwords? When using truecrypt, the maximum character limit on passwords is 64 characters; however, when using WinRAR, the limit is 128 characters. What determines the length of passwords I can use with AES?
Is AES restricted to only 64 characters for the key/password?
I've read that cracking 128-bit key is currently [out of reach of all humanity][1]. However, I can't seem to find any information on what scope of brute force attacks have been performed or are possible at the current time. Can someone provide some information on this subject with quotable reference? [1]: http:/...
What is the largest performed/possible bruteforce attack to date?
Or more generally, is there a function or algorithm that is slow to calculate/execute, has a reliable execution time, and has a result that can be tested much more quickly than the calculation took?
Is there a hash algorithm that is slow to calculate but relatively fast to check?
How can one run a chosen plaintext attack on RSA? If I send some plaintexts and get the ciphertexts how can I find a relation between them? Thanks
For instance, what makes MD4 a bad choice for an HMAC? In this case I am asking about MD4 because its less than ideal. I know that a preimage attack can be used to undermine the system, but why? What is the attacker calculating?
Why does a broken hash function undermine an HMAC?
Having a "rotating" square Cardan Grill with sides long n cells, how could i determinate the cost of a brute-force attack? How many configurations should be considered to perform an exhaustive search?
What is the brute-force attack's cost in a rotating square Cardan grille of side even n?
Since EAX is very flexible with regard to the length of the calculated MAC (what they call "tag" is the MAC value right?), and the eax paper as well as other documentations carefully avoid sugesting any value for the length of the MAC, is there anything to take into consideration before setting for a value? Is the l...
EAX MAC or "Tag" Length?
Since EAX is very flexible with regard to the length of the calculated MAC (what they call "tag" is the MAC value right?), and the eax paper as well as other documentations carefully avoid sugesting any value for the length of the MAC, is there anything to take into consideration before setting for a value? Is the l...
Is there any freely available verilog implementaion of Diffie-Hellman key exchange? I couldn't find anything using google. So, assuming its not there I started implementing on my own. The code is hosted at https://github.com/nulpoet/verilog_diffiehellman. Behavioral simulation in xilinx works. However it cannot s...
How can one run any attack on RSA? If I send some plaintexts and get the ciphertexts how can I find a relation between them? Thanks
How can one run a chosen plaintext attack on RSA? If I can send some plaintexts and get the ciphertexts, how can I find a relation between them which helps me to crack another ciphertext?
How does a chosen plaintext attack on RSA work?
The NIST recommended HMAC uses HMAC$_k$(x) = H$_{out}$( (k $\oplus$ opad) || H$_{in}$((k $\oplus$ ipad)||text) ) Is it feasible to analyze the security and efficiency with different hash function implementations for H$_{in}$ and H$_{out}$ for a single instance? I would like to know whether it makes sense to u...
DIfferent inner and outer hash functions for NIST Recommended HMAC?
The NIST recommended HMAC uses HMAC$_k$(x) = $H_{out}$( (k xor opad) || $H_{in}$((k xor ipad)||text) ) Is it feasible to analyze the security and efficiency with different hash function implementations for H$_{in}$ and H$_{out}$ for a single instance? I would like to know whether it makes sense to use differe...
The NIST recommended HMAC uses $HMAC_k(text) = H_{out}( (k \oplus opad) || H_{in}((k \oplus ipad)||text) )$ Is it feasible to analyze the security and efficiency with different hash function implementations for $H_{in}$ and $H_{out}$ for a single instance? I would like to know whether it makes sense to use di...
I am confused about the hardness of the one-way function behind cryptography -- if someone could factor the large number produced back into two primes quickly then the one-way function would be broken? TIA
I am currently completing a dissertation concerning the encryption of data through a variety of cryptographic algorithms. I have spent much time reading journals and papers but as yet have been unable to find any record of their performance complexity. Would anyone have an idea of the Big-O complexity of the foll...
You may want to take a look at the [original HMAC paper](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.134.8430) by Bellare, Canetti and Krawczyk (1996), or at the [new security proof](http://cseweb.ucsd.edu/~mihir/papers/hmac-new.html) by Bellare (2006). As far as I can tell at a glance, there's nothing i...
The NIST recommended HMAC uses $$\operatorname{HMAC}_k(text) = H_\mathrm{out}( (k \oplus \mathrm{opad}) \operatorname\| H_\mathrm{in}((k \oplus \mathrm{ipad}) \operatorname\| text) )$$ Is it feasible to analyze the security and efficiency with different hash function implementations for $H_\mathrm{in}$ and $H_\m...
Having a "rotating" square Cardan Grill with sides long n cells, how could i determinate the cost of a brute-force attack? How many configurations should be considered to perform an exhaustive search? EDIT FOR MORE DETAIL: This was an exam question so these are all the information given to me, but i think i c...
The actual question is stated at the end of the text. Suppose you have a (grossly inefficient) confidentiality stream cipher with the following components: 1. The keyed function $F_k:\{0,1\}^{8n}\mapsto\{0,1\}^{16n}$ based on vectors with randomized padding multiplied with a key dependent matrix as described [in a p...
I am learning about crypto, purely for my own interest. As part of that I am implementing a simple 'one time pad' toolset in C. Naturally I need to generate random numbers to create the pad, and they need to be cryptographically strong. I know about rand(), but from what I can tell it is not strong. Is there a...
What is the correct way to generate cryptographically-secure pseudorandom numbers in C?
Given a binary shift register of $n$ bits, a **primitive** binary nonlinear feedback shift register will generate a sequence with a period of $2^n - 1$. While I am unable to find a paper which directly describes the methods, the paper [A List of Maximum Period NLFSRs][1] has just came up on eprint, which lists all N...
What are the methods to construct a primitive binary nonlinear feedback shift register (NLFSR)?
Advantages of using a HMAC over RSA with SHA-1 hashes?
**Edit**: *See the comments, this construction is not provably secure* After some more thought, the answer is "yes", you can construct a hash from a stream cipher. (My other answer from a few days ago was only negative, eg, how *not* to construct it.) Here is a construction. First build a block cipher $B$ from th...
I'm trying to understand (to reproduce in practice) how does blinded tokens work. Currently i'm lacking examples. According to [Wiki][1] the blinded signature protocol is the same as ordinary signature protocol. So maybe it is possible to reproduce it with the help of openssl? I want to reproduce by hand all the steps ...
I'm planning to encrypt some individual files for storage, using the GnuPG implementation of RSA. If I happened to encrypt the private key corresponding to the public key used for encrypting -- either as an internal GnuPG file or an ASCII-armored exported key -- would this constitute a vulnerability? The key in ques...
I've recently looked a bit at pairing based cryptography and I was wondering what properties the groups involved should have in order to be useful for cryptographic purposes? Has anything more exact been formulated? As an example, we could just take the pairing $\mathbb{Z}_p\times \mathbb{Z}_p\to \mathbb{Z}_p,\;\; (...
I am currently studying for an exam and this was a previous question: > Give one advantage of using HMACs over using RSA to sign SHA-1 hashes. My thoughts are that it has something to do with the fact that HMAC assumes a private key has already been shared so there is no need to use public-private keys. But wo...
What are advantages of using a HMAC over RSA with SHA-1 hashes?
Since EAX is very flexible with regard to the length of the calculated MAC (what they call "tag" is the MAC value right?), and the [EAX paper][1] as well as other documentations carefully avoid suggesting any value for the length of the MAC, is there anything to take into consideration before setting for a value? Is...
What "Tag Length" should be used for the EAX MAC?
Probably the simplest cipher is the xor cipher with a single integer. One can extend this to use more than one integer by several means. I'm wondering if there is any benefit to doing more than this: Let $x_n$ be the $n$th data byte to encrypt and $p_k$ be the data stream (password or whatever) to encrypt with and $...
Probably the simplest cipher is the xor cipher with a single integer. One can extend this to use more than one integer by several means. I'm wondering if there is any benefit to doing more than this: Let $x_n$ be the $n$th data byte to encrypt and $p_k$ be the data stream (password or whatever) to encrypt with and $...
In RSA, a message is encrypted by $m^e \pmod N$. $N$ is the modulus, $m$ is the message and $e$ is the public exponent. (I know that $m$ should not be greater than $N$.) My question is, can $m^e$ be greater than $N$ (obviously, before taking the modulus)? In that case is there a possibility like $ m_1^e=m_2^e \p...
Can RSA encryption produce collisions?
Actually, your intuition is correct; if $f$, $g$ and $h$ are publicly known functions (and are unkeyed except for the $p_k$ inputs), then the more complex construction is not much stronger than the original simpler cipher. Indeed, it is vulnerable to ciphertext-only attacks just like the simpler method (assuming, of c...
The scenario is single-use passphrase-based non-interactive message authentication. The obvious try to do this is to chose a random salt of the appropriate length and send: concat(workfactor, salt, message, mac(scrypt(workfactor, salt, passphrase), message)). That protocol is as secure as scryp...
I've been trying a long time to understand a thing which is obviously extremely simple, but i just can't get it. Read this,please: > The NTRUEncrypt PKCS uses the ring of truncated polynomials R combined with the modular arithmetic described in Section 1. These are combined by reducing the coefficients o...
Using n-bit ECDSA, a signature has a size of 2*n. It is possible to recover the public key from this signature, which shows that there is a publicly visible redundancy in the signature. Is it possible to exploit this redundancy to reduce the signature size to n bits, sacrificing key recovery? I suspect it's not poss...
I want to encrypt a file with AES in CTR mode. I have a 256 bit master key and the file. Given these, the encryption must be deterministic, so I can't use a random nonce in the usual way. Fortunately the master key will be unique¹. My original plan was to simply set the nonce to 0. Assuming no collision happens when...
I am looking for any source (a survey of similar) that summarises the state of the art and which are the most used signature schemes today. (I am mainly interested into knowing which are the schemes that are really mostly used nowadays). Anyone can point anything out?
Using n-bit ECDSA, a signature has a size of 2*n. It is possible to [recover the public key](http://www.secg.org/download/aid-780/sec1-v2.pdf) from this signature, which shows that there is a publicly visible redundancy in the signature. Is it possible to exploit this redundancy to reduce the signature size to n bit...
It is my understanding that while a practical solution to the factoring problem will definitely break RSA, it has never been proven that the security of RSA is equivalent to factoring. In otherwords, theoretically, someone could mathematically break RSA without breaking the factoring problem. Are there any proble...
Using $n$-bit ECDSA, a signature has a size of $2·n$. It is possible to [recover the public key](http://www.secg.org/download/aid-780/sec1-v2.pdf) from this signature, which shows that there is a publicly visible redundancy in the signature. Is it possible to exploit this redundancy to reduce the signature size to $...
Can one reduce the size of ECDSA-like signatures?
Most frequently used digital signature schemes today?
I am looking to understand if there are any hard figures on which digital signature schemes are most commonly in use today. I'm only really interested in what is employed recently (ie. last couple years), as opposite to what was adopted then years ago. If you could include the figures and link the relevant source...
I am looking to understand if there are any hard figures on which digital signature schemes are most commonly in use today. I'm only really interested in what is employed recently (ie. last couple years), as opposite to what was adopted then years ago, and especially what's employed in systems in which the bandwidth...
I am looking to understand if there are any hard figures on which digital signature schemes are most commonly in use today. I'm only really interested in what is employed recently (ie. last couple years), as opposite to what was adopted say ten years ago, and especially what's employed in systems in which the bandwi...
I am trying to wrap my head around the benefits of salt in cryptography. http://en.wikipedia.org/wiki/Salt_(cryptography) I understand that adding salt makes it harder to precompute a table. But exactly how much harder do things get with salt? It seems to me, like when you add salt, the number of entries in yo...
How much bigger does a precomputed lookup table get when salt is added?
I am looking at implementing NTRU but I noticed that while the encryption/decryption algorithm seems to be mature and well-documented, there is comparitively little information about how to sign using NTRU (and the proposed method apparently leaks information about the private key). My question is, why can't I just ...
I am looking at implementing NTRU, but I noticed that while the encryption/decryption algorithm seems to be mature and well-documented, there is comparatively little information about how to sign using NTRU (and the proposed method apparently leaks information about the private key). My question is, why can't I just...