instruction
stringlengths
33
27.2k
I developed a p2p-app in C# which sends and receives encrypted text messages (50kB). For encryption, my app uses 128-bit AES in CBC cipher mode. For each message it uses a new randomly-generated IV. However, after reading the following two publications, I have some concerns about my solution: First solutions for SSL/...
Due to a number of recently asked questions about Diffie-Hellman, I was thinking this morning: must $g$ in Diffie-Hellman be a generator? Recall the mathematics of Diffie-Hellman: Given public parameters $p$ (a large prime) and $g$ (always referred to as a generator of $\mathbb{Z}^*_p$). Alice chooses $a$ at random an...
I understand that signing is often a case of hashing data and then encrypting the hash with the private key. What properties keep Diffie-Hellman from being useful for this?
I'm using PHP to encrypt a string and Java to decrypt it on a remote server. To perform the encryption, I'm using the strategy that can be found here. My problem is that the strings I encrypt are pretty small and very similar each other. Nevertheless, I'd like a high degree of randomness in the encrypted values. Just t...
My understanding of HOTP is that each password is unique and based on a counter. $$PASSWORD = HOTP_1(K,C)$$ Where $C$ is an incremental counter. What I wish to know, is how you keep the client and server in sync? Looking at current systems (google authenticator), there appears to be no indication if the actual 'coun...
I, myself, do not plan on getting into a situation where I would be unable to use a computer in order to communicate securely. However, I can think of many practical situations in which mental cryptography would be useful. Is there a secure cryptosystem that is simple enough to be performed mentally? Clearly, one of t...
For the purposes of signing and verifying signatures, what is the value of the hash function? Why would it matter if SHA1 is later determined to be easy to break? Since a Public/Private key process is still used, is SHA1 only a utility to create smaller data to sign? The data itself is also sent in the clear most of th...
Two highly-critical papers by Koblitz and Menezes (two well-regarded mathematicians who've contributed to the crypto community) were published years ago: Another Look at “Provable Security” in 2004, Another Look at “Provable Security”. II in 2006. Have these papers had any noticeable impact on how research is conducted...
Using the terminology of the ECDSA Wikipedia page, ECDSA (and DSA) signatures require a random k value for each signature which ensures that the signature is different each time even if the message and key are the same. For some applications, a "constant" signature may be desirable. It seems to me that there would be n...
Why is Google using RC4 for their HTTPS/SSL? $ openssl s_client -connect www.google.com:443 | grep "Cipher is" New, TLSv1/SSLv3, Cipher is RC4-SHA Isn't RC4 unsafe to use?
I want to write AES from scratch without using the built in libraries of java. I know there are hundreds of AES programs (and websites) out there but I can't seem to find a site that gives me the details I think I would/should need to write my own Java program. I know that AES has S-boxes like DES has. Were would I loo...
Here SIM means the simulation based security Consider a two message encryption scheme:$$Enc:K \times M \times M \rightarrow C \times C$$ and $Enc(K, m, m')=(K \oplus m, K \oplus m')$, In the real world experiment, the adversary $Eve$ gets $(K \oplus m, K \oplus m')$ as ciphertext, and thus, the information leaked to $...
I have seen many examples of encryption up to about 256-bit. But how does one programmatically scale the logic upwards in a language such as PHP or Java to say 1024-bit or even 4096-bit and higher? Are there any websites that explain the workings of a very large encryption on a modern 64-bit computer? For example what ...
I am thinking quite a lot lately abut the problem of secure, privacy-preserving social networking. Distributing the network among trusted, preferably self-hosted servers (like Diaspora, GNU Social etc. attempt to do) is obviously not a good solution for the the large majority of non-technical users, so my thoughts curr...
What is the "Random Oracle Model"? Is it an "assumption" akin to the hardness of factoring and discrete log? Or something else? And why do some researchers have a strong distrust of this model?
So Bob grabs Alice's secret key when she isn't looking and her encrypted files, doesn't he need to know her passphrase to read her files? What I am reading is that no he does not need it but as far as I understand GPG, it would still ask for a passphrase to decrypt a document. Please explain why Bob would not need to ...
Lets say for a PGP/GPG pair with a passphrase.
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 they a...
At the current time, is SHA256 the de facto standard for strong cryptographic hashes? From what I am seeing of more sites utilizing it, I would suppose the answer to this is yes, but would like to hear what the community here has to say about this and why it is happening.
Is there any scheme, ideally one widely used or at least widely available, where you can treat both the signing and verifying keys as secret? Basically, the functionality I'm looking for is this: You derive two keys, $S$ and $V$. $S$ cannot be derived from $V$, nor can $V$ be derived from $S$. A signature can be made ...
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?
Text book question of Chapter 9 of "Crypto and Network Security" by William Stallings: When using the RSA Algorithm — if a small number of repeated encodings give back the plain text, what is the likely cause this happens?
Sometimes the easiest way to describe security of a type of cryptography is to say that "the time it takes to solve for an x-bit key would be y years". How would one go about doing such a calculation for RSA, DH, and ElGamal. In other words, given x, how to solve for y?
What are cryptographic reasons to choose an authenticated-encryption mode of operation (such as GCM) over a traditional encryption mode plus an independent MAC, or vice versa? Assume there is no implementation reason to pick one or the other (crypto library supports both, no backward compatibility constraints, etc).
Does any one have, or can refer to a Known-Answer-Test (KAT) for Triple DES Keying Option 2? (Keying Option 2 means $C = DES_{k_1}(DES^{-1}_{k_2}(DES_{k_1}(P)))$ for encryption and $P = DES^{-1}_{k_1}(DES_{k_2}(DES^{-1}_{k_1}(C)))$ for decryption, where $k_1$ and $k_2$ are independent parts of the key bundle.) I have d...
I'm implementing a protocol which needs a 64-bit IV for every encrypted packet. The cipher in use (AES-GCM, more or less as specified in RFC 4106) does not require that these IVs are random, only that they are not repeated for any given key. However, the protocol imposes the additional requirement that every byte on ...
Arguably the PKCS suite of standards have a profit-oriented bias as they are promoted by RSA and promote their algorithms over others in the form of RFCs and other means. I'm considering the possibility that this information bias may include disinformation or omission regarding substitute algorithms that may be equally...
I'm looking at the SEED algorithm and would like to know if this is still in common usage. Can anyone tell me when I would need to implement this standard, either as a client or a server?
PGP/GPG can used to sign text, others use public key to verify them. So one could say, that these cryptographic algorithms deal with space. Are there any algorithms that can deal with time? E.g. I sign a document at 2011-12-31 23:59:59, others can verify this document is really, truly signed at 2011-12-31 23:59:59. I k...
Does the following quote imply that valid encrypted data can be created and decrypted by someone other than the owner of a private key: An asymmetric encryption scheme is considered to be broken if an attacker can decrypt a given ciphertext, even if he can convince you to decrypt arbitrary other ciphertexts What ...
Does Encrypt-then-MAC provide equal confidentiality, integrity and authenticity as other constructs such as EAX? If yes, how do I go about using it? My current understanding is: E = encrypt(plaintext) H = hash(E) output(H || E) Is that correct?
The scrypt algorithm seems to be a prominent feature in the "CPU friendly" Bitcoin clones for the proof-of-labor part. I've heard claims that it's relatively slow on Windows and/or Intel compared to Linux/AMD. Is this true? By how much? Does anyone have concrete data on this? Is there a difference between 32 bit and 64...
Wikipedia states that RSA challenge has been withdrawn. Does it mean that an efficient factoring algorithm is "just around the corner"? or are there some other reasons? If the challenge was still open people would have even more confidence in RSA.
RIPEMD is a family of cryptographic hash functions, meaning it competes for roughly the same uses as MD5, SHA-1 & SHA-256 do. The Wikipedia page for RIPEMD seems to have some nice things to say about it: "designed in the open academic community" "not [...] constrained by any patents" I rarely see RIPEMD used in comme...
Is it correct that increasing the iteration possibly decreases the cipher strength but increases the amount of time it would take to find the original hash values if using brute-force on a given hash? (i.e. from a compromised database)? In other words, if someone accessed user password hashes would be better to protect...
I need to use a hash function to generate a 128-bit key for a symmetric cipher. The specific cipher is from the eStream portofolio, called Rabbit. I am using the SRP protocol for authentication (a type of EKE protocol). As a result of this, both parties will calculate the same large integer value and need to hash it in...
In a project that I'm currently working on, we are encrypting some data using AES with ECB mode in a database. Each piece of data being encrypted is very small, no more than 10 characters long. Very importantly, each entry of that database is encrypted using a different and unique key. Would we gain any security if we ...
I want to make a system that needs to store some confident user information in a database. I intend on using OpenID for user authentication. I would like encrypt the data in a way that it can only be decrypted when the user is logged in. What are the most common approaches to storing user's data securely in such a setu...
Is there any pair of 128-bit strings M and K such that AES$_K$(M) = M? If yes, how do I go about (efficiently) finding such a pair?
I'd like to have an implementation of elliptic curve cryptography along the lines of secp256k1 which is secure until some information is published after which it is broken. One idea would be to use elliptic curves over a ring $Z_n$ where $n=pq$ or perhaps $n=pqr$ where $p$, $q$ and $r$ are primes of similar size and th...
Is there a safe way to uniquely identify a symmetric key? I know with asymmetric keys you typically use a hash of the public key, but I assume that using a hash of a symmetric key would reveal too much information. Would you simply have to assign a GUID to each key and ensure that those GUID/key pairs never get lost ...
Is there a publicly available cryptographic hashing algorithm with 2048 bit output? The standard ones are "only" up to 512 bit (SHA-512, WHIRLPOOL). (2048 bits are 256 bytes, so it would be useful for generating a full-length key for the ARC4 cipher)
I wish to manipulate short ASCII strings (namely unpredictable domain names) into a form which cryptographically assures authenticity and confidentiality, for use in the local part of email addresses. Furthermore, the resulting email addresses should be valid according to most address validators (including the many ma...
Does anybody know how to break monoalphbetic substitution cipher, if it is applied to some pseudorandom text (for example to some surrogate key filed in a database)? Let us assume that we have only cipher text, and don't know anything about distribution of different characters appearance probabilities, so frequency ana...
I have some pairs of plaintext and ciphertext data, from which I need to be able to decrypt the other passwords stored in the database. The password field typically contains something like ENC:LCznyFywN+3J+AD330rqHg== ENC:D3H2ODVCAzkzQzRr8ZbJdw== The raw data for the first is 1234, and the second 62369. ENC: denotes...
Is there a deniable encryption scheme $M = E(p_1,k_1,p_2,k_2,...,p_n,k_n), p_j = D(M,k_j)$ of $n$ plaintexts $p_1,p_2,...,p_n$ and $n$ keys $k_1,k_2,...,k_n$, such that we can fix $D$ to be a known algorithm such as AES (without preprossessing $M$) and such that $|M| \ll \sum_{i=1}^n {|p_i|}$ (since this leaks informat...
I decided to read the original RSA paper A Method for Obtaining Digital Signatures and Public-Key Cryptosystem because of a question I had about RSA (which is not the question I'm about to ask, but may be a question on here at some time) and came across something I had never seen before in any textbook description of R...
EDIT: Ilmari Karonen's answer below well not exactly what I want, gives a very good idea of what I am trying to accomplish. Are there any known secret sharing schemes that allow new parties to be read in on a portion secret, preferably without all parties having to be online at the same time? I don't want to have to k...
Let the preimage resistance be defined as »given a hash value $h$, it is hard to find any message $m$ such that $\operatorname{hash}(m)=h$«, and let the second preimage resistance be defined as »given a message $m_1$, it is hard to find any message $m_2$ such that $\operatorname{hash}(m_1)=\operatorname{hash}(m_2)$«. T...
In page 9 (16 in the PDF) of Final report of European project IST-1999-12324 (NESSIE), 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 for block cipher...
Would it be possible to break an RSA key, in for example 1 week of time, if the cracker have already spent X number of years building an index of primes by performing every permutation of existing prime keys up to $2^{2048}$? I understand this would take an immense amount of time to do, but it would only be done once. ...
Does anyone know how to do a Diffie-Hellman or ECDH key exchange with more than two parties? I know how to do a key exchange between 2 parties, but I need to be able to have a key agreement between 3 or more parties.
I read the following from Understanding Public Key Cryptography on Microsoft TechNet: Using a private key to establish identity shows that the full encryption and decryption operation was accomplished successfully. Showing a full operation means that plaintext would have to be encrypted to ciphertext using a pri...
Every definition of pseudorandom generator that I've seen says it takes n-bit strings and gives poly(n)-bit strings. Is there a proof that if there is such a pseudorandom generator then there is a pseudorandom generator that takes n-bit seeds and repeatedly outputs bits on request? Things I would be curious about that ...
The RUB in Germany reports that XML encryption is broken. This is essentially the W3C standard for protecting XML documents from prying eyes. Does this mean that an attacker can only see a single message, or that they can actually infer the encryption key for all messages? Is this a new vulnerability in CBC? How is th...
I want to create a system to encrypt a document and store it with a 3rd party, but not have the 3rd party be able to decrypt it until some unspecified later date. It seems like the solution would be to split the key into two parts, given to two different trusted 3rd parties. Then when the date arrives those 3rd parties...
I'm trying to choose a group that is hard under the Chosen-Target Computational Diffie-Hellman assumption, according to the definition in this paper, in order to implement the oblivious transfer scheme defined in the top box on page 10(=406). The (intimidating, to me) CT-CDH assumption is defined as follows (page 7=403...
I'm putting together a password policy for my company. I very much want to avoid requiring complex passwords, and would much rather require length. The maximum length I can enforce is 14 characters. I can calculate that 14 random lower case characters is stronger than 8 characters using anything on the keyboard. How...
The Data Encryption Algorithm is designed to encipher and decipher blocks of data consisting of 64 bits under control of a 56-bit key. If my data is more than 64 bits, (suppose 66 or 67 bits), will it take remaining bits as 0s (zeros)? How would it encrypt?
A "practical attack against XML's cipher block chaining (CBC) mode" has been demonstrated: XML Encryption Flaw Leaves Web Services Vulnerable. Does this weakness of CBC-mode which is used here also affect SSL/TLS? Related: Is the CBC weakness in XML Encryption a new discovery? Are other applications vulnerable?
If $H(m)$ is a secure hash function, can't we implement a MAC using $H(k\mathbin\Vert m)$? However, it seems the more widely used MACs, such as NMAC and HMAC (both originally defined in Keying hash functions for message authentication) use a much more complicated scheme. Why is this concatenation scheme insecure?
A fixed length CBC-MAC uses an all-zero block as the initialization vector. Suppose that we used a randomized IV instead, and sent the IV along with the tag. So if the message $m$ will be $m = b_1 || b_2 || b_3 || ... || b_l$, the MAC will be $(IV, t)$ where $t$ is the authentication tag defined as normal. Why is this ...
I am trying to understand how CBC-mode in SSL/TLS can be attacked. I have been looking around online but all examples and explanations are very hard to understand and follow. Can you give a simple explanation for how such attacks happen?
Assuming some large block of text is encrypted with an enigma machine and I only know a small subset of letters before and after encryption, how do I go about figuring out the enigma settings from this point?
I can't get an intuitive understanding of why it's $2^{(\frac{n}{2})}$ and not $2^n$, where $n$ is the number of bits of which the key consists.
I read this article on Wikipedia: Hard-core predicate. Still I don't understand what exactly is a hard-core predicate. Is it possible to put this in simple English terminology, and perhaps with a simple example?
If in a public WLAN WPA2-PSK is used, but the PSK is more or less publicly available, does this mean that an attacker with that PSK can easily decrypt wlan traffic from/to other clients of that WLAN? Or does WPA2 negotiate sort of a per-client encryption key, so that while an intruder can access the WLAN, he's still no...
I'm looking at an OpenVPN connection between two sites configured to use 128 bit Blowfish in CBC mode, and trying to figure out how to assess the strength, but I just don't know enough of the maths. I could ask this over on Sec.SE, but there I think the focus might be on whether it should use 3DES instead of Blowfish –...
I got two 8-byte strings. One which is decrypted is: FF FF FF FF FF FF FF FF and one which is encrypted is: 16 05 78 B0 0A C2 78 7F Encryption mode is CipherMode.ECB I need the key used in DES encryption.
So I'm messing around in the BouncyCastle library with the RFC 3394 AES Key Wrap engine and I'm trying to understand the benefit of it. The problem I'm running into is how to store keys securely on a device like a phone or even a laptop or desktop. I need to wrap the keys so that anyone snooping around in memory can't ...
Wikipedia says: Key Wrap constructions are a class of symmetric encryption algorithms designed to encapsulate (encrypt) cryptographic key material. We are using these algorithms to encrypt (and authenticate) a key, using a symmetric algorithm (and symmetric key, named key encryption key). Some of these algorithms a...
Is there a secret sharing scheme where the knowledge of just one share is sufficient to find the secret, in other words a (one-out-of-n) sharing scheme ? Plz I need to know if it is possible to make such operation with secter sharing
In usual $(t, n)$ secret sharing schemes, a secret $S$ is split into $n$ parts so that any $t$ out of $n$ parts reconstruct the original secret. So, suppose that there is a group of $n$ participants each one has a secret $x_i$ ($x_i$ may be its private key). My question is, is it possible to create a secret $S$ using t...
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)\i...
For a project using RC4, the output is to be mapped to values of 0 to 35. Thus, only 36 unique output values representing the letters A to Z and 0 to 9. To avoid bias, the RC4 byte output (with a range of 0 to 255) is discarded if the value is greater than 251. The output is then mod 36, which then maps the output in...
What are the most authoritative papers on the security analysis of ECDSAs? I`m mainly looking for comparisons of how secure different curves are considered to be, what potential methods are there of discovering a private key based on the public key, and possibly the methods of cracking the entire curve. Moreover, paper...
Let's say that there is a binary file encrypted with AES in CBC mode (i.e. using a key and initialization vector). If key is known, but IV is not, is it easy to fully decrypt the file? How hard is it?
A number of cryptographic functions have constants built in. For example, the constants used in RFC 2104 for HMAC, or the constants used in s-boxes (e.g., DES and AES), or MD5. In general, how are constants such as these generated so as not to arouse suspicion of tampering or weakening?
I was looking through the working of SSL V3, and found that a connection state is defined by a set of things, including client write mac secret, server write mac secret, server write key, client write key. I couldn't found the use of these in the SSL protocol. As I understood from reading, after having a handshake, S...
The generation of key materials is given by key_block = MD5(master_secret + SHA('A' + master_secret + ServerHello.random + ClientHello.random)) + MD5(master_secret + SHA('BB' + master_secret + ServerHello.random + ClientHello.random)) + MD5(master_secret + SHA('CCC' + mas...
I would like to learn more about cryptography. Let's say you encrypt multiple files with CBC encryption using the same key, but each file has a unique (and pseudorandom) IV. Does this weaken the security of the data? Is it easier to obtain the key if you have many instances of the same data encoded with a different IV?...
I am often told that any key can be broken and that it is only a matter of time and resources for any key to be broken. I know that this is technically true. However, I think that there is probably a point where it makes sense to say a key is uncrackable (for example, if it would cost 100 times the world GDP to crack i...
Im trying to figure out what the best way to encrypt data sent between a webpage and the user(both ways) is, when hosted in an environment that doesn't support SSL. The purpose of encryption would be obscuring content for delivery through filters that aid in internet censorship. What ways would that be possible to acom...
I came across the requirement that, in RSA, $p-1$ and $q-1$ shouldn't be smooth, shouldn't consist of lots of small factors. Therefore my question: How complicated is it to check whether $p-1$ is smooth? (And how is it done?) Knowing the complexity of finding out, is it reasonable to actually check? For instance, doe...
Let assume two participants Alice and Bob who perform a given protocol which is a sequence of messages exchange between them. My question is: How can I provide a secure and authentic communication channel using cryptography, so that when Bob sends a message "M" to Alice, the latter will be able to know whether or not t...
I couldn't understand the avalanche effect in DES. Could someone explain how avalanche effect happens in DES
What is the principle of linear cryptanalysis, as applied to a block cipher ? For instance, this page gives the rough outline of differential cryptanalysis.
I would like to maintain a list of unique data blocks (up to 1MiB in size), using the SHA-256 hash of the block as the key in the index. Obviously there is a chance of hash collisions, so what is the best way of reducing that risk? If I also calculate the (e.g.) MD-5 hash of the block, and use the combination (SHA-256,...
What is "preimage resistance", and how can the lack thereof be exploited? How is this different from collision resistance, and are there any known preimage attacks that would be considered feasible?
My professor told me: If a public-key crypto-system is secure against ciphertext-only attacks, then it is also secure against a chosen-plaintext attack. Why is this true? Is there a proof that confirms this?
I'd like to implement a "Product Registration" scheme into my software where upon initial use, the User must enter a key to unlock it. The key they enter is compared to their encrypted Username. They would have to acquire the key from myself if they wished to use the software. Their encrypted Username must be reasona...
Suppose one wanted to use RSA encryption for the sole purpose of sending key bits for use in symmetric crypto systems, a dedicated key exchange system so to speak. And say you didn't think that the presently used RSA key lengths were going to be secure in ten or fifteen years. What would be some of the technical diffic...
If $H$ is a typical secure hash function, then $(k,x) \mapsto H(k \mathbin\| x)$ is not a secure MAC construction, because given a known plaintext $x_1$ and its MAC $m_1$, an attacker can extend $k \mathbin\| x_1$ to a longer message with the same hash. Is $(k,x) \mapsto H(k \mathbin\| \mathrm{len}(x) \mathbin\| x)$ (w...
I recently ran across elliptic curve crypto-systems: An Introduction to the Theory of Elliptic Curves (Brown University) Elliptic Curve Cryptography (Wikipedia) Performance analysis of identity management in the Session Initiation Protocol (SIP) (IEEE) Overview of Elliptic Curve Cryptosystems. (RSA.com) It seemed to ...
An old exam question I am trying to figure out: Consider the following protocol for two parties to flip a fair coin. Trusted party T publishes her public key pk A chooses a random bit $b_A$, encrypts it under pk, and announces the ciphertext $c_A$ to B and T B does the same and announces a ciphertext $c_B$ T decryp...
I've implemented an API for one of my clients, it relies on nonces and a shared secret. The structure: Client's Site (CS) requests nonce from My App (MA), posting their username MA verifies the username is valid, then generates a nonce in response The nonce is only valid for the given username and is only valid for 1...
One of the inputs of RSA-PSS signing and verification is the salt size. According to PKCS#1, you must know the salt size before the verification is carried out. However, this makes interoperability impossible: if, for example, I want my program to verify a signature generated by OpenSSL, then I can't do the verificatio...
I've been reading up on bilinear maps and their application to cryptography and one thing I keep seeing hasn't yet clicked. If $e:G_1\times G_2\to G_n$ is a bilinear map, $G_1,G_2,G_n$ are always defined as having the same order. It seems to me, however, that $ord(G_n)$ should be $ord(G_1)\cdot ord(G_2)$. Is there a ...
I'm trying to get a grasp on AACS and Subset Difference (archived version with images) for a project I'm working on and am having a hard time coming up with a technically valid layman explanation, let alone implementation. Is it fair to say that the content is encrypted once per public key (device key), resulting in se...
I've come up with a light weight bit wise encryption algorithm and seems good. Ive tried it with text and image input. But I've the following questions I would like to ask What do you think of bit wise encryption schemes. Pros and cons (performance and security wise) How could I compare the security level and the perf...