instruction
stringlengths
32
27.2k
I need to sign the numbers from 1 to 1 billion (literally this, it's not an analogy) using a digital signature and then send these numbers in a particular order to someone. The message is not private and the receiver should be able to verify its authenticity without having to reply; it's a one-way public communication ...
A cryptosystem is using AES-128 in CCM mode with random IV. Suppose an attacker capable of: asking the cryptosystem to encrypt a single plaintext as many times as he wants; and asking the cryptosystem if any ciphertext is valid (ie, if it decrypts to some plaintext) The attacker knows what is the single plaintext tha...
I have noted some sources indicate that when using a KDF like PBKDF2 (alternatively) some advocate injecting the salt at the time of execution - like this: dv = salt + PBKDF2(salt + password, salt) Versus the "plain" usage of dv = PBKDF2(password, salt) When using the PyCrypto.Protocol.KDF PBKDF2 function or Armin Ro...
so I am busy writing a TCP protocol in which I send a "packet header" with each packet of data. This packet header is a structure that contains information about the data that was sent. I want to verify whether the header was tampered with in some manner and I am thinking of using a hash of the header to ensure it was ...
In a paper they write once, $(\mathbb{Z}_n^*)^2$. Is this the group of quadratic residues or is it something else? Here the theorem: Under the strong RSA assumption, given a modulus $n$, along with random elements $g, h \in (\mathbb{Z}_n^∗)^2$, it is hard to compute $w \in \mathbb{Z}_n^*$ and integers $a, b, c$ such th...
Show The function $mult(a,b)$ is weak one way if the Integer Factorization Assumption is true. I am read the proof of this enunciated but I want know if I understand this in my way. The proof use the lemma: For $k$ big, the probability for one number with $k$ bits, choosen in random form, is prime is greater than $1/k...
I've heard that hash algorithms like bcrypt are more secure because they take longer to complete, and therefore take much longer to brute force, without a noticeable delay for legitimate users. Would using a faster algorithm, such as SHA-256, multiple times, be secure? For example: hash = "password" for x in range(5000...
Is there a way to derive the formulas for point addition and multiplication on elliptic curves in Jacobian format by yourself? How could I have derived these formulas by myself?
The Scenario I have a message string I need to transport over a wireless network that may be unreliable. This message string is about 100 bits long, and is packaged with an 8-bit CRC. When the message is received, it's validated with the CRC and unpacked. I would like to add a few "message version" bits to the message,...
There have been several questions regarding password hashing here and on Security.SE. A "pepper" is sometimes mentioned – an application-specific secret key. The canonical answer on password hashing implies that a adding pepper brings the composition close to a MAC, and that cryptographic MAC function should be used ra...
If I use the AES-256 option in WinZip to encrypt a file, is it any less safe or less secure than using PGP encryption?
I just started some work on computation over encrypted data in the cloud. We're still in the early planning stages, and to really understand the kind of security we can offer I need to determine what kind of attacks to expect from an untrusted cloud server. My basic question is whether the cloud represents a semi-hones...
I'm encrypting files using an AES-256 CBC cipher and an SHA-256 HMAC every 64KB in the file. Since AES CBC needs an amount of input bytes to be divisible by 16, I use PKCS#7 padding to bring the amount of bytes up to a count divisible by 16 at the end of the file. For this and for most cases of cryptography, does know...
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mathbb...
Basic question- if I'm encoding a bunch of known filetypes with salsa20, will it still be secure if the plaintext header is known? Assume that a different IV and Key are generated before each file is encrypted (or at least, it's statistically impossible for an attacker to know whether or not different files were encryp...
I would like learn about use neural networks in cryptography. Is there any research literature on this subject? What should I do to learn about the subject? I am taking short course in neural networks and for the course project I would like to do something in neural cryptography.
A few months ago, XKCD posted a challenge to find a plaintext which hashed (using Skein 1024 1024) to a specified value. Inputs were scored based on the hamming distance between the hash of the specified input and the desired hash. The top scorer, from Carnegie Mellon, found a plaintext whose hash matched all but 384 b...
Look at the hex dumps of encrypted1.bin and encrypted2.bin . They both have same password A which was used to encrypt sampletext [achilles:~/Arena/crypto] $ openssl enc -e -des -in plaintext -out encrypted1.bin enter des-cbc encryption password: Verifying - enter des-cbc encryption password: [achilles:~/Arena/crypto] ...
A lot of sites (e.g. Dirk Rijmenants') refer to 10-side dice to generate random number for one-time-pad. I was thinking about new ways to generate random numbers, letters and passwords. here what I got… To generate random numbers: Take out keys numbers from 0-9 from old keyboard, calculator or mobile pad and put it in...
I can find JavaScript implementations of SRP (Secure Remote Password protocol), but nothing that inspires confidence for Diffie-Hellmen key exchange. I also have a separate need for SRP later. I would like to do key exchange under the assumption that I've already done mutual authentication (through some out of band use...
How do I do a literature search of the research literature on cryptography? Assume there's some topic in cryptography I'd like to learn more about; how do I search the cryptographic research literature to find research papers that might be relevant? What's the best process to use for finding relevant research?
Linear Feedback Shift Registers (LFSRs) can be excellent (efficient, fast, and with good statistial properties) pseudo-random generators. Many stream ciphers are based on LFSRs and one of the possible designs of such stream ciphers is combining outputs of $m$ LFSRs as input of a boolean function $f:GF(2)^m\rightarrow G...
For the reasons I cannot go into details, I need to design my own protocol and overall security system which will be used to establish secure data exchange between various devices (most notably desktops of all three major OSes, Android and iOS devices and Raspberry Pi, with the possibility to extend it to other embedde...
Let's suppose we have an Alice who knows a secret key A, and Bob who knows key B. Using their own keys, they each encrypt a message (Alice encrypts $m_A$, Bob encrypts $m_B$) with their own key, and send the encrypted messages to one another. Now is there some cryptographic scheme thinkable that lets Alice only decrypt...
One requirement states that the generator has to withstand the next-bit test. Consider the following PRNG, where we calculate next output $x_i$ via the formula $x_i = x_{i-1}^ e\mod n$. I can see that this PRNG withstands the "state compromise extensions" (can't guess previous states). However, given $x_i, e, n$ an ad...
I read in http://epubs.surrey.ac.uk/7219/2/esorics06.pdf that in exponential El Gamal the discrete log problem for recovering $m$ from $g^m$ can be made tractable when $m$ is drawn from a binomial distribution. Why is this?
I ported GnuPG to Javascript using Emscripten (not released yet). Now I need a good replacement for /dev/random//dev/urandom. New browsers support window.crypto.getRandomValues() but for older browsers I need something else. I was thinking about recording some audio using HTML5 and calculating the sha 512-bit digest. T...
Suppose Alice is using a password prompt that only accepts up to 32 characters for any particular password. Memorization of long strings of random characters is not one of Alice's strengths, so she opts instead for a memorable passphrase consisting of a permutation of 7 of the 2000 most common English words. Unfortunat...
We're building a data service that is expected to go out through a single "fat pipe" channel. The design requirement says that the data in the channel must be protected by authentication and encryption. I'm ready to argue that the strongest encryption for such a system (single channel, multiple subscribers) is the "cab...
The Wikipedia entry Fair exchange has only two lines, and the only paper I can find describing such a protocol is extremely complicated. Is this a new field in cryptology or can someone give an example of actual use or provide a simple implementation?
On Solaris there's a function pkcs11_PasswdToKey() which is a wrapper of C_GenerateKey(). I made a simple test and it turned out that pkcs11_PasswdToKey() only supports following CKK_types: CKK_AES CKK_BLOWFISH CKK_DES CKK_DES2 CKK_DES3 CKK_RC4 From my understanding, other symmetric ciphers (like CKK_IDEA) should also...
I'm writing a TLS 1.2 implementation (in C#) using a custom protocol. My question is how to generate the IV attached to each message, I don't want to use RandonNumberGenerator because I've heard it is slow. Instead, I would like to use some PRNG. I'm only going to suppport AES-128/-256. From reading around I understan...
Is using sensor raw data a good way of generating true random numbers? I mean using an IPhone's gyro/accelerometer raw output as a base for generating an array of true random numbers.
Is there any mathematical result that gives us the minimum number of 1's in a 160-bit SHA-1 hash output? What is the probability that a 160-bit SHA-1 hash output contains at least 128 1's?
Suppose we use elgamal elliptic curves for secure communication. Bob selects a prime $p$, an elliptic curve $E$, a point $\alpha$ on $E \pmod p$, and a secret integer $f$. Suppose that Bob has selected $p =8115633240307$; $E: y^2 = x^3 + 45x + 1$; $\alpha = (1728910711, 274151521448)$, $f=7$; How would we calculate $\b...
Informally, In functional encryption system , a decryption key allows a user to learn a function of the encrypted data. But all i see is that the function acts as an access control over the data. Can we have richer functions, say can a user add two cipher texts and get the result in plain text using decryption key ? ...
My area of expertise is reverse engineering, specifically embedded systems. I do attack cryptographic systems, but this largely involves key recovery or exploiting the implementation. I was asked to reverse engineer a simple Windows executable used as part of a challenge-response protocol used for intruder alarm system...
I am going to apply a simple substitution cipher to my input, then encrypt the result with a Hill cipher. How can this be broken, in a chosen-plaintext threat model? In other words, instead of the standard mapping of letters to numbers (A=0, B=1, .., Z=25), I will randomly reorder them (e.g., A=22, B=12, ...), where t...
Using an encryption algorithm like AES, is it possible to generate a fixed length cipher text no matter how long the plain text becomes?
I'm in the process of designing a cryptographic protocol which will reduce the impact an attacker will have if they gained root access to a server storing data. The basic crux of it is that keys which were used to encrypt data are not stored on the server and are only ever in memory for a short period of time. The bas...
The heart of OAEP algorithm used for RSA encryption are the cryptographic hash functions $H$ and $G$. Does everybody (so also an adversary) know these functions? If YES: How does it help the security, if he just can decode the padding and read the message? If NO: What knowledge is needed for these functions? Are keys...
I want to multiply and divide polynomials, and implement the extended Euclidean algorithm for polynomial greatest common divisors, over a Galois Field of size $2^{128}$. Moreover, I want to use the previous algorithms on an 8-bit microcontroller (ATMega128). Where can I find relevant libraries in C or Assembly? Ι would...
I'm taking an online class on cryptography at corsera.org / Stanford, and the professor is explaining that it's OK to truncate an AES MAC to $w$ bits as long as $1/2^w$ is still negligible (say $w > 63$) Where did the value $1/2$ come from? How is 64 and above negligible? What is non-negligible today (5/17/2013) and i...
Background: My current server-provider tells me it's no problem to store the passwords in plain-text in the database, saying he has to do so because they use CRAM-MD5 for email authentication. But something tells me that storing password in a database in plain text might not be the only security issue that comes up her...
Basically what the title is; GUIDs are unique by design. If you run the GUID through SHA1 and then Base64 the hash, will the resulting string have the same guaranteed uniqueness as the GUID, or not?
I'm looking at using HMAC + CBC. The combination looks like this: ciphertext = AES256(text, k1) data = HMAC-SHA256(iv | ciphertext, k2) | iv | ciphertext Where: k1 = 32 byte key - Randomly generated, once k2 = 32 byte key - Randomly generated, once iv = 16 bytes - Randomly generated, for every message The purpose is ...
While reading some text on cryptography, I found that algorithm $A$, that the adversary (called Eve by convention) runs to break the cipher message, needs two parameters, candidate message ($y$) and length of message ($k$). Now, this $k$ is being supplied in unary. The reasons for that are being put forth in one text...
Sometimes, websites and scientific papers that introduce and/or handle cryptographic algorithms also provide speed-analysis and tables comparing the individual performance of cryptographic implementations. I would like to do the same, but I'm not sure how to calculate the “cycles”. I have this data: processor clock fr...
Computerized cryptanalysis has obviously made formerly "secure" hand ciphers like Playfair, Four Square, and the Hill Cipher obsolete because they can be defeated in seconds. But is there a hand cipher where a modern computer attack does not have an advantage over a cryptanalysis done by hand? There are certainly tasks...
What types of algorithms that are capable of signing a message are out there that run on a physical level, e.g. lacking the infrastructure of a standard PC, no memory, processor or motherboard in the traditional sense? I'm curious whether there are some strong really low level implementations (if these statements don't...
I recently found this site, proposing a hashing algorithm for passwords. They describe the following: pad the password on both sides with SHA1(email) to 4 * length(password) HMAC(padded password, global salt) choose a random salt of 22 characters bcrypt(hmac, salt) Is this algorithm secure? I think it might be a secu...
I'm reading the proof of the implication "Def 2.1 $\Rightarrow$ Def 2.4" in these slides about Adversarial Indistinguishability and Perfectly-Secret Encryption. I have a doubt in the slide 10. Here it says: Construct an adversary $A$ who outputs $m_0$, $m_1$ in the first step of $\mathsf{PRIV_{EAV}}(\Pi,A,n)$. Then ...
I'm thinking about buying a USB TRNG. How do I evaluate its randomness? I'm sure some are better than others but which is which? Are thermal-noise better than radio-noise TRNGs?
In a previous question, I described a particular keyed "hash" that mapped a 5-digit input code into a 5-digit output code. It used a 8-bit key which is very insecure - more than 99% of the time, you can infer the key given a single input/output code pair. I put "hash" in inverted commas as although it has something in ...
I was looking a Wikipedia article on SHA-2, and the "Comparison of SHA functions" table seems to indicate that SHA-2 is less secure than SHA-1. Is this true, or is the table wrong / misleading? What does $2^{28.5}$ mean for SHA-256 compared to $2^{60}$ for SHA-1 (table in SHA-1 article says $2^{53}$)? How does it rela...
Assume the following structure: version | iv | ciphertext | HMAC(version | iv | ciphertext | ..., key) The version starts out to be a "random" 64-bit number. It identifies the key used to encrypt the ciphertext for the purpose of key rotation (version is not, nor does it contain any part of the key). For every message...
In my cryptography class, the instructor suggested that in order to give the attacker a minimal advantage of $1/2^{32}$, we have to change the key after $2^{48}$ blocks are encrypted. It seems that the advantage of $1/2 ^{32}$ is somewhat arbitrarily chosen, and I'm not sure where that comes from. Can anyone explain t...
In the AUTH and UF-CMA games, an adversary is required to forge a ciphertext or message/tag pair to win the game. Given an encryption scheme $E$ and a PRF $F$, let $\hat{E} = C || F_k(C)$ and $C = E(x)$ (encrypt-then-MAC with PRF as MAC), how is the birthday attack mounted? I understand it is sufficient to ask ~ $\sq...
I'm working with the affine representations of points of the Secp256k1 elliptic curve (from Bitcoin). I've read many papers that show that computing some functions, like $f(P)=3P$ can be computed faster than the standard way. Other papers say that with some pre-computation, the field inversion can be amortized if $F^1(...
First let me apologize if this is an ill posed question. Let me also note that I do not in any way seek a comprehensive answer, simply your thoughts on what makes for a valuable asset to a company like the NSA. I am a Maths student in the US, and I realize that a problem-solving mind is at minimum required for said que...
I'm going to develop a system that will have two keys. One supplied and generated by the system that's specific to an individual user and one from the user. I plan on using AES. Does it make sense to: Concatenate the two keys to make a "master" key and then encrypt the data? Encrypt with one key and the encrypt again ...
 In RSA, some security authorities and/or standards allow the public exponent $e=3$, others require or recommend $e>2^{16}$ (or perhaps some other minimum). I gathered the following: PKCS#1 allows $e=3$ for both RSA digital signature and encryption (but see 3. below). ISO/IEC 9796-2 allows $e=3$ (in the context of RSA...
I have a question regarding the key generation process of methods that are based on the discrete logarithm problem. This site gives some good insights, but I don't fully grasp it I think: http://www.keylength.com/ For example I know that till lately one should have used 1024 bit group modulus and a 160 bit long secret...
I need an implementation of linkable ring signature, a ring signature which allows identifying whether two signatures belong to the same signer. It has important privacy-related applications, like e-voting, but unfortunately there seems to be no public implementation. So I'm going to roll my own. The simplest method se...
I doing a project using ABE "Attribute-Based-Encryption" but i didn't understand what actually the function for $e(g,g)^xy$. Just tell what's the calculation need to perform here. I gone through no of publications and thesis but i didn't understand this. $PK = (T_1 = g ^{t_1} , ..., T_{|u|} = g^ {t|U|} , Y = e(g, g)^ ...
I'm debugging an application which communicates between client and server using a SSL/TLS connection, and want to capture and analyze the sent data. Are the client write keys and server write keys enough to decrypt the data, or do we also need the MAC keys?
While studying the RSA algorithm I referred to some books and some sites such as RSA (wikipedia) and all of them chose {d,n} as the secret (private) key and release {e,n} as the public key but as d and e are multiplicative inverse of each other, can't we keep {e,n} as private key and use the other as public key? Is it ...
We read in literature that verification of a digital signature is slower using DSA than if we used RSA. Why is this? DSA parameter generation: choose prime number $p$ choose prime number $q$ such that $q \mid (p-1)$ $g = h^{\frac{p-1}{q}}\mod p$ with $1 < h < (p-1)$ (multiplicative order) private key: choose $x$ such...
I've seen the elegant way of splitting a key among different people so that only a certain number need to be present to re-compute the key, yet nobody has enough information to re-compute the key on their own. For example, if I want to split $K$ between 4 people, such that any 3 can re-compute the key, I first form a p...
If I'm able to prove that any scheme satisfies confidentiality ad unforgeability conditions, will it be a valid signcryption scheme, without explicit signature and encryption parts ?
I have two devices that need to verify that they both are in possesion of the same secret key. One of the devices is a very limited embedded device that only has AES128 available, no SHA or other hash variants. My idea is a basic two-way challenge-response scheme: Device 1 generates 8 bytes of random data (C1), and se...
(I thought twice before asking this question and quite reluctant to type as well, but I think this would be helpful). I am an undergrad student and choose theoretical computer science as my major. Now I want to pursue a grad study in cryptography and I want to know the best universities in this field of mathematics and...
Sorry for my dumb question, but it's better to ask dumb question than to do dumb things silently. I want to encrypt user email in my DB so that if someone stole the DB (and not the key) - he won't be able to restore the email adresses. But I need to be able to find user by email in my DB. And I can't iterate over all t...
A recent paper by Göloğlu, Granger, McGuire, and Zumbrägel: Solving a 6120-bit DLP on a Desktop Computer seems to "demonstrate a practical DLP break in the finite field of $2^{6120}$ elements, using just a single core-month". They credit a 2012 paper by Antoine Joux: Faster index calculus for the medium prime case. App...
I would like to encrypt some data using a combination of multiple keys. There would be two keys: a client keys that would be generated for each client and a single server/application key used by everyone. The idea is to be able to encrypt/decrypt the data only if we are in possession of both keys. So neither the server...
When conducting surveys, an Administrator might send an Enumerator to survey a Respondent. For "sensitive" questions (e.g. about embarrassing behavior), the Respondent may be fine with the truth being revealed to the Administrator but not to the Enumerator. Is there a way to create a one-way function/process using sim...
From the Handbook of Applied Cryptography, in discussions of key sharing algorithms, I see definitions: Implicit key authentication is when one party is assured that no other aside from a specifically identified second party has the possibility to determine the secret key (§12.2.1). Entity authentication is when one i...
I have heard about ciphers that have a block length of 256 megabytes. That is huge. How well are they understood by the encryption community? I'm referring to PMC Ciphers. Has anyone used such a cipher in a real world application?
I've noticed confusing definitions about permutation and substitution, preventing me from understanding the difference. A permutation changes the order of distinct elements of a set, but this can be written as a function changing one element by another, exactly as a substitution. So, how exactly can we distinguish betw...
I'm reading about the notions of security concerning digital signatures and I can't understand whether RSA is more secure than El Gamal digital signature. Well, they are both prone to forgery, but I don't see which signature is better in terms of security.
These days I'm reading about quantum computing and quantum cryptography which I've found extremely interesting. Well, I also read some blog posts of Bruce Schneier talking about how quantum computers threaten our current asymmetric crypto-systems. However, I don't know whether quantum computers also threaten symmetric ...
Sometimes I read that a nonce has to be a random number but I disagree. A nonce just can't repeat itself. You could increase in by 1 every time if you are sure it would never repeat.
Given sha1(pad(A) || pad(B)), where B is known, can I calculate sha1(pad(A))? pad(A) means its length is exactly 1 block (64 bytes for SHA-1) If yes, for which other hash functions it will work too? Would it work vice versa when A is known? Why do I think it's possible? If you take a look on SHA-1 source, 16 ints bloc...
I am writing an application, running on a server, where multiple users access data from a database which is AES encrypted with a master secret. The master secret itself is initially randomly generated, and then AES encrypted with a user-secret to yield a 'user-hash'. The master secret is never stored, but the user-hash...
Given many pairs of $(m, t)$, can the attacker compute the key $k$ satisfying $\text{HMAC}(k,m) = t$? (Assume that $k$ was chosen at random.)
Could someone point to results or proofs about the probability of $$HMAC(k, m_1) = HMAC (k, m_2)$$ assuming the underlying hash function is SHA-256? Would those probabilities be higher/lower if $m_1$ and $m_2$ are not independent? Please don't point to birthday attack results. I am only interested in the probability t...
How to test if a number is a primitive root, assuming the $\text{mod}\enspace m$ where $m$ is a prime? And if not? Is it not enough if the number is relatively prime to the modulus or prime? I'll write down what I've done and would like to know if I'm right: I tested if the modulus is prime with the Rabin-miller test. ...
Why cryptographic hash functions must be collision-free and is there any methods to evaluate whether a function is not resistant to collision? Thanks,
What better Encrypt the file once with 50 characters password or encrypt it twice each time with 25 characters password.
After just reading the post Do recent announcements about solving the DLP in $GF(2^{6120})$ apply to schemes proposed for cryptographic use? I was a bit confused. DSA, ElGamal and others are based on the assumption that DLP is a hard problem to solve. The DLP problem can be defined in different cyclic structures, but m...
Considering the output of a cryptographic primitive, like an encryption scheme (CBC, ...), a hash function or even the output of any schemes based on number theoretic assumptions, is it reasonable (acceptable) to assume that these outputs are random when proving the security of a protocol/algorithm which relies on the ...
Recently, there has been quite a lot of news about the Chinese compromising various US weapons systems and stealing military designs through "cyberwarfare". I am reading the news sources about these attacks, but popular news sites often refer to the technical details as "solving complicated mathematical problems" or ju...
I'm working with understanding the internals of the Tate Pairing. I was going through an example of the curve $E: y^2 = x^3 + 3x$ over $\mathbb{F_{11}}$. The author is showing the computation of $e(P,Q)$, where $P=(1,9)$ and $Q = \phi (P) = (10,9i)$ using Miller's Algorithm. Through this algorithm, the author chose a p...
Any understanding I have of cryptography stops right around the cipher level. As such, I'm just curious as to why bit shifts and moreover circular bit shift are so prevalent in cryptography.
There are 100 bytes with a CRC16. However I only know the first 50. I want to change byte 5 from a known value X to another value Y, and fix up the CRC16 to be valid - without knowing bytes 50-100. This is possible with the TCP checksum, because it's just addition. But CRC16 is a polynomial. Is it still possible?
I am in attempt to understand relative insecurity of certain encryption schemes. Particularly of interest is DES and RC2. I know AES is better and should be used to encrypt. But practically, if something is encrypted with (1) DES or (2) RC2 (3) RC4 what level security is achieved. In affect I am asking: If a adversery ...
As you may know, the Gödel Prize 2013 will be awarded this year to cryptographers (see this ACM press release). The people awarded are Antoine Joux, the team of Dan Boneh and Matthew K. Franklin. Can somebody explain their contribution to cryptography ?
I'm quite new to cryptographic systems, and today we discussed entropy at work. Since entropy is used to ensure the difficulty for an attacker to break in, I was wondering if the more time the high entropy value remains the same, the more the system becomes vulnerable. Is the concept of entropy related with the time (l...
I choose at random an invertible square matrix A of size 128 in GF(2). I want to use this matrix as a substitution box. Is this a non linear transformation ? I've seen that substitution boxes are the non linear parts of a block cipher algorithm, but the product between A and x is linear ? Not ? There is something that...
I've been reading about the S/KEY One-Time Password system on wikipedia here and was wondering why the server only stores a single password and not the list of one-time passwords like the client does. In other words, why is the implementation not a simply a password-to-password compare but instead a cryptographic hash...