instruction stringlengths 15 30k |
|---|
I've implemented an API for one of my clients, it relies on *nonces* and a *shared secret*. The structure:
1. Client's Site (**CS**) requests nonce from My App (**MA**), posting their *username*
2. **MA** verifies the *username* is valid, then generates a *nonce* in response
- The *nonce* is only valid for the... |
What is the proper way to use a client nonce? |
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 verfication 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 verification... |
Using a cryptographic hash to store e.g. passwords in a database is considered good practice (as opposed to storing them plaintext), but is subject to attacks on said cryptographic hash, assuming the database is compromised.
Which properties of a cryptographic hash function make it suitable for hashing passwords and... |
I've implemented an API for one of my clients, it relies on *nonces* and a *shared secret*. The structure:
1. Client's Site (**CS**) requests nonce from My App (**MA**), posting their *username*
2. **MA** verifies the *username* is valid, then generates a *nonce* in response
- The *nonce* is only valid for the... |
Normally, the salt length is part of the signature parameters, i.e. the things which tell you that the signature is indeed of type RSA-PSS, what hash function is used and what mask generation function is used.
Many protocols use ASN.1 to encode such parameters (e.g. [CMS][1], the offspring of PKCS#7 and basis for si... |
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 th... |
Must the order of the groups in a bilinear map be the same? |
I'm trying to get a grasp on [AACS and Subset Difference][1] and am having a hard time coming up with a technically valid layman explanation.
Is it fair to say that the content is encrypted once per public key (device key), resulting in several copies of the movie on the same DVD?... given that a DVD player can onl... |
I'm trying to get a grasp on [AACS and Subset Difference][1] for a [project][2] 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 several copies of th... |
All amateur encryption schemes are insecure. Professional schemes may, or may not, be insecure but the amateur ones always fail. The fact that you are asking this question indicates that you are an amateur.
If you just want your Aunt Jemima not to be able to read your stuff, then fine. If your Aunt Jemima works f... |
There is no such thing, but there is something called a _chosen-ciphertext attack_.
In this kind of attack, the attacker is assumed to have a way to trick someone who knows the secret key into _decrypting_ arbitrary message blocks and tell him the result. The attacker can choose some arbitrary nonsense as an "encryp... |
Can someone explain - using a simple example - how a chosen ciphertext attack works?
Thanks in advance
Mike |
Can someone please explain - using a simple example - how a chosen ciphertext attack works? |
How does a chosen ciphertext attack work, with a simple example? |
I've seen a lot of 2-party applications that derive a shared key from distinct keys created by each party.
Why is this technique employed? Would it not be better to use those two distinct keys for each party (where both parties know both keys, but each key is used to encrypt and decrypt the messages of the party who... |
Derived Shared Key vs Distinct Keys? |
I've seen some proofs of MAC security that are based on the extremely-unlikely event that two MAC tags collide (ie, they are equal for distinct messages). Suppose that this extremely unlikely event occurs, then what? Can we forge arbitrarily more messages with this same tag? With ANY tag? Or even better, do we get ... |
What are the consequences of a MAC tag collision? |
The following is a definition taken from Introduction to Modern Cryptography by Chapman&Hall.
I'm having a hard time understanding some basic concepts! Can you please help me?
____
Consider the following experiment for any private-key encryption scheme
Π=(Gen,Enc,Dec), adversary A, and value n for the security ... |
Can you help with that definition for a CCA? |
The following is a definition taken from Introduction to Modern Cryptography by Chapman&Hall.
I'm having a hard time understanding some basic concepts! Can you please help me?
$\newcommand{\Gen}{\operatorname{Gen}}\newcommand{\Enc}{\operatorname{Enc}}
\newcommand{\Dec}{\operatorname{Dec}}$
> Consider the foll... |
I've seen a lot of 2-party applications that derive a shared key from distinct keys created by each party.
Why is this technique employed? Would it not be better to use those two distinct keys for each party (where both parties know both keys, but each key is used to encrypt and decrypt the messages of the party who... |
Generally, these protocols are used to generate symmetric keys from asymmetric keys. You start out with asymmetric keys because that's the only way one party can talk to another party securely without pre-arranging a shared secret. You want to wind up with a symmetric key because only a symmetric key is suitable for bu... |
The following is a definition taken from Introduction to Modern Cryptography by Katz and Lindell.
I'm having a hard time understanding some basic concepts! Can you please help me?
$\newcommand{\Gen}{\operatorname{Gen}}\newcommand{\Enc}{\operatorname{Enc}}
\newcommand{\Dec}{\operatorname{Dec}}$
> Consider the ... |
Programmer here,
Is this a safe way to implement a license key:
1) After the user downloads the program, he connects to a website and sends his Windows product ID.
2) The website, then, sends this back to him with a signature using a private RSA key.
3) The program, then, checks, using a public key, whether it i... |
Is this a safe way to implement a license key? |
Programmer here,
Is this a safe way to implement a license key:
1. After the user downloads the program, he connects to a website and sends his Windows product ID.
2. The website, then, sends this back to him with a signature using a private RSA key.
3. The program, then, checks, using a public key, whether it... |
Programmer here,
Is this a safe way to implement a license key:
1. After the user downloads the program, he connects to a website and sends his Windows product ID.
2. The website, then, sends this back to him with a signature using a private RSA key.
3. The program, then, checks, using a public key, whether it... |
Programmer here,
Is this a safe way to implement a license key:
1. After the user downloads the program, he connects to a website and sends his Windows product ID.
2. The website, then, sends this back to him with a signature using a private RSA key.
3. The program, then, checks, using a public key, whether it... |
I have this idea of implementing a license key:
1. After the user downloads the program, he connects to a website and sends his Windows product ID.
2. The website, then, sends this back to him with a signature using a private RSA key.
3. The program, then, checks, using a public key, whether it is really signed b... |
Is a RSA-signature of some identifying data a safe way to implement a license key? |
I am trying to get my head round the chi square test when used with the Caesar cipher.
I started off using this formula,
chi = SUM[i = 1 to k] ( f[i] * f'[i] ) / ( n * n' )
Where k is the number of distinct letters in the alphabet, f is the number of times the i'th letter appears in the first string and f' is... |
Example of CHI Square test on Caesar Cipher? |
I am trying to get my head round the chi square test, when used with the Caesar cipher.
I started off using this formula,
$$ X = \sum_{i = 1}^k \frac{f_i · f'_i}{n · n'} $$
Where $k$ is the number of distinct letters in the alphabet, $f$ is the number of times the $i$-th letter appears in the first string and $... |
Can somebody please tell what is the message space in the following example and how a message space relates to a security definition?
I mean what diference does it make to such a definition if your message space is {0,1}^n or if its {0,1}?
>We say (K,E,D) is (t,ε)-IND-CPA secure if for all t-bounded adversaries... |
What is the message space in the following example and how does a message space relate to a security definition?
I mean, what difference does it make to such a definition if your message space is $\{0,1\}^n$ or if it is $\{0,1\}$?
>We say $(K,E,D)$ is $(t,ε)$-IND-CPA secure if for all $t$-bounded adversaries Ad... |
What is the message space in the following example and how does a message space relate to a security definition?
I mean, what difference does it make to such a definition if your message space is $\{0,1\}^n$ or if it is $\{0,1\}$?
>We say $(K,E,D)$ is $(t,ε)$-IND-CPA secure if for all $t$-bounded adversaries Ad... |
What is the message space in the following example and how does a message space relate to a security definition?
I mean, what difference does it make to such a definition if your message space is $\{0,1\}^n$ or if it is $\{0,1\}$?
>We say $(\mathsf{K},\mathsf{E},\mathsf{D})$ is $(t,\epsilon)$-IND-CPA secure if ... |
I have strings that are if the form:
{static data}{changing data}
The beginning static data part is around 20 characters and is common to all strings. The last part is around 5 characters and is different for each string.
The string is encrypted using unsalted blowfish. Can the fact that the beginning dat... |
Does knowing common prefixes help crack blowfish? |
There is some doubt as to whether the original poster actually means encryption or not. If they do, as pointed out "unsalted" is not relevant. However, for those wondering if actually encrypting data with a known prefix and short suffix is secure or not, the following is the answer.
This applies to any message taken... |
There is some doubt as to whether the original poster actually means encryption or not. If they do, as pointed out "unsalted" is not relevant. However, for those wondering if actually encrypting data with a known prefix and short suffix is secure or not, the following is the answer.
This applies to any message taken... |
I have strings that are if the form:
{static data}{changing data}
The beginning static data part is around 20 characters and is common to all strings. The last part is around 5 characters and is different for each string.
The string is encrypted using blowfish (from xjava.security.Cipher) with a fixed ini... |
I've built a simple block cipher that works as follows:
$k$ is a 256-bit key.
$S$ is a 16-bit S-box that has the following properties:
- The probability that any random two bits $S[a]_b$ and $S[c]_d$ are equal (for any random $a$, $b$, $c$ and $d$) is 50%.
- The probability that any random two bits $S[a]_n$... |
Security of simple xor and s-box cipher? |
What desirable properties should an S-box have?
My current standard selection process is to just pick them at random and verify that they fit the following criteria:
- The probability that any random two bits $S[a]_b$ and $S[c]_d$ are equal (for any random $a$, $b$, $c$ and $d$) is 50%.
- The probability that ... |
What weaknesses (or strengths) do block ciphers based on only key xor and s-box have when operating in CBC mode?
A cipher's internal primitive might be a simple as this:
$C = S[M \oplus k]$, where $C$ is ciphertext, $M$ is the plaintext message, $k$ is the key and $S$ is an S-box.
Assume the follwoing:
- T... |
What weaknesses (or strengths) do block ciphers based on only key xor and s-box have when operating in CBC mode?
A cipher's internal primitive might be a simple as this:
$C = S[M \oplus k]$, where $C$ is ciphertext, $M$ is the plaintext message, $k$ is the key and $S$ is an S-box.
Assume the follwoing:
- T... |
What weaknesses (or strengths) do block ciphers based on only key xor and s-box have when operating in CBC mode?
A cipher's internal primitive might be a simple as this:
$C = S[M \oplus k]$, where $C$ is ciphertext, $M$ is the plaintext message, $k$ is the key and $S$ is an S-box.
Assume the follwoing:
- T... |
Create your one for learning, very simple?
a = b = c = a0h;
for (every byte "byte" from input)
a = a XOR byte;
b = b XOR a XOR 55h;
c = b XOR 94h;
end for
print a, b, c;
Study a real one?
Do some search in google about the algorithms used in [MD5](https://www.... |
I've been recently looking into the creation (and theory) of Hash Functions, however I just can't figure out how to turn a message into a fixed length.
At the moment, my theory of a hash function is like so:
1) Take in the message (e.g. "secret")
2) Split it into different 'blocks' (e.g. "sec" + "ret")
3) M... |
What desirable properties should an S-box have?
My current standard selection process is to just pick them at random and verify that they fit the following criteria:
- The probability that any random two bits $S[a]_b$ and $S[c]_d$ are equal (for any random $a$, $b$, $c$ and $d$) is 50%.
- The probability that ... |
I've been recently looking into the creation (and theory) of hash functions, however I just can't figure out how to turn a message into something of a fixed length.
At the moment, my theory of a hash function is like so:
1. Take in the message (e.g. "secret")
2. Split it into different 'blocks' (e.g. "sec" + "... |
How can I create a fixed length output in my hash function? |
A hash function is a function with an arbitrary-length input size (e.g. $\{0,1\}^*$ or some subset), and a fixed length output ($\{0,1\}^n$, with $n$ fixed for the function).
How can we get something like this?
The "ideal" hash function, a [random oracle][1], simply spits out a random fixed-size string whenever a... |
What weaknesses (or strengths) do block ciphers based on only key xor and s-box have when operating in CBC mode?
A cipher's internal primitive might be a simple as this:
$C = S[M \oplus k]$, where $C$ is ciphertext, $M$ is the plaintext message, $k$ is the key and $S$ is an S-box.
Assume the follwoing:
- T... |
Let a "block cipher" be defined with a fixed S-box $S$ (i.e. a permutation of some space) and a key $K$ (same size than a block), such that the encryption of a block $M$ is $C = S[P\oplus K]$. Everybody knows $S$ and can apply and invert it (that's a "S-box", not a "key" -- if the S-box is "key dependent" then the S-bo... |
The weakness [CWE-329][1] is an [interesting problem with CBC mode][2]. However, does this same weakness affect the other [modes of operation][3] that rely upon an IV such as: PCBC, CFB and OFB? My gut feeling is, **YES**. I am wondering if there a consensus on this topic? Or is there a possible explanation of why ... |
A [hash function][1] is a function with an arbitrary-length input size (e.g. $\{0,1\}^*$ or some subset), and a fixed length output ($\{0,1\}^n$, with $n$ fixed for the function).
(For cryptographic uses, we also want some more properties, like collision-resistance, preimage resistance and second-preimage resistance -... |
Each mode of operation has its own IV requirements. Some need uniform, unpredictable randomness. Other are equally happy with just uniqueness.
CBC is well-known for its need of an IV chosen randomly and uniformly among the possible IV values, and such that an attacker who can choose the text to encrypt may not predi... |
*Create your one for learning, very simple?*
a = b = c = a0h;
for (every byte "byte" from input)
a = a XOR byte;
b = b XOR a XOR 55h;
c = b XOR 94h;
end for
print a, b, c;
The output size here will be always only 3 bytes (assuming `a`, `b`, `c` are bytes), independ... |
I've seen ciphers (usually in spy drama shows) that involve taking a book and writing down an index to individual characters. Essentially it's a keyed substitution cipher where the key is the name and exact edition number of the book.
Example:
Imagine a book has 500 pages, 5 paragraphs per page, 5-10 lines per pa... |
How secure is a book cipher? |
I've seen ciphers (usually in spy drama shows) that involve taking a book and writing down an index to individual characters. Essentially it's a keyed substitution cipher where the key is the name and exact edition number of the book.
Example:
Imagine a book has 500 pages, about 60 lines per page and about 80 cha... |
Is a book cipher probably secure? |
hummm... some thoughts about it:
1. I think that it could be secure depending on what you want to hide. The bigger and the more "real world words" you want to protect, the easier it gets to crack. Why? Because in books, in general, you'll only have letters, few numbers, and that's only. Ok, so I know your transmitti... |
Is there perhaps some *neural* expository article on crypto systems based on non-abelian groups?
I've gleaned that <a href="http://en.wikipedia.org/wiki/Anshel–Anshel–Goldfeld_key_exchange">Anshel–Anshel–Goldfeld key exchange</a> is the most well-known cryptographic algorithm based upon non-abelian groups. Do peopl... |
How does the wider cryptographic community view non-abelian group based cryptography? |
In cryptography, you care not merely that some problem is hard but that hard instances are readily producible.
Why don't people use NP-complete problems for cryptography, for example? An NP-complete problem would give you greater confidence asymptoticly speaking for two reasons : If any NP-complete problem were c... |
In my experience, I never have found that cryptographers base their opinion of a cryptosystem on the properties of the underlying group. If its a braid group, abelian group, or finite field: that does not really matter. What matters is, as @Thomas notes, how hard do we think the problem is in a particular setting?
... |
I interested in developing DES(in verilog) for my college project.Can i get help in understanding the simulation results of DES encryption and decryption ?
thanks in advance . |
If the GCD(r, p-1) is small and the value k is used to sign a message using ElGamal is also small. Then the secret value of x can be determined.
Why is this true? How would one retrieve x?
http://en.wikipedia.org/wiki/ElGamal_signature_scheme |
I'm taking a crypto class this semester and after learning the definition of a perfect cipher I started wondering how this definition applies to AES.
Obviously AES isn't a perfect cipher since the key length is only 256bit at the maximum but when talking about blocks of sizes 128bits-256bits can one claim that AES i... |
For an [ElGamal][1]-like signature scheme, I am given two things:
1. The signing function,
2. the verification function.
How can I show that the verification function is valid?
Example 1:
Signing: $s := x^{-1}(m - k·r) \pmod {p - 1}$
Verification: $g^m = (g^x)^s · r^r \pmod p$
NOTES:
$g$ is the ge... |
How can one show that an ElGamal-like signature verification scheme is valid? |
I'm taking a crypto class this semester and after learning the definition of a *perfect cipher*. I started wondering how this definition applies to AES.
Obviously AES isn't a perfect cipher, since the key length is only 256 bit at the maximum. But when talking about messages of sizes 128 bits to 256 bits, can one cl... |
Your scheme is not the "true" [ElGamal signature scheme][1]: you swapped $x$ and $k$. I assume that $m$ is the _hash_ of the message to sign, not the message itself.
Your scheme is _sound_, which means that the verification algorithm will return "ok" for a signature which has been generated as you suggest. To see th... |
Your scheme is not the "true" [ElGamal signature scheme][1]: you swapped $x$ and $k$. I assume that $m$ is the _hash_ of the message to sign, not the message itself.
Your scheme is _sound_, which means that the verification algorithm will return "ok" for a signature which has been generated as you suggest. To see th... |
A digital currency system like <a href="http://anoncvs.aldigital.co.uk/lucre/">Lucre</a> (<a href="https://github.com/FellowTraveler/Open-Transactions/wiki">OpenTransaction</a>) creates a coin by a mint blind signing the output of a hash function, which the payer then unblinds and pairs with the input to the has functi... |
Is there any serious discussion about using blinding intermediaries in digital currency scenarios? |
There is some Thermodynamic Limitations. A good explanation about Thermodynamic Limitations is by Bruce Schneier in [Applied Cryptography][1]:
> One of the consequences of the second law of thermodynamics is that a
> certain amount of energy is necessary to represent information. To
> record a single bit by changi... |
Hugo Krawczyk has a paper titled [The Order of Encryption and Authentication for Protecting Communications (or: How Secure Is SSL?)](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.106.5488&rep=rep1&type=pdf).
It identifies 3 types of combining authentication (MAC) with encryption:
1. Encrypt then Authent... |
Most of the time, when some data must be encrypted, it must also be protected with a [MAC][1], because encryption protects only against passive attackers. There are some nifty encryption modes which include a MAC ([EAX][2], [GCM][3]...) but let's assume that we are doing old-style crypto, so we have a standalone encryp... |
Should we MAC-then-encrypt or encrypt-then-MAC? |
I've seen ciphers (usually in spy drama shows) that involve taking a book and writing down an index to individual characters. Essentially it's a keyed substitution cipher, where the key is the name and exact edition number of the book.
Example:
Imagine a book that has 500 pages, with approximately 60 lines per pa... |
Is a book cipher provably secure? |
For security of ECC, the choice of the irreducible polynomial is unimportant, because all finite fields with the same cardinal are isomorphic to each other (and the isomorphisms are easy to compute); this is why we can say "_the_ finite field $GF(2^{163})$" even though there are many irreducible polynomials of degree $... |
There is apparently a provably secure cipher that was proposed by Diffie but enhanced by another cryptographer that works like this:
1. Measure the length of the plain-text, n.
2. Multiply it by 128.
3. Generate this much real random data and split it out in to 128 byte arrays of equal length to the plain-text.... |
There is an apparently a provably secure cipher that was proposed by Diffie but enhanced by another cryptographer that works like this:
1. Measure the length of the plain-text, n.
2. Multiply it by 128.
3. Generate this much real random data and split it out in to 128 byte arrays of equal length to the plain-te... |
About **difficulty of insuring that $p-1$ is not smooth**: it is easy to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then test prime candidates $p=2 \cdot k \cdot p_1+1$, for consecutive $k$ such that $p$ is of app... |
There is an apparently a provably secure cipher that was proposed by Diffie, but enhanced by another cryptographer. The scheme, which was mentioned in Applied Cryptography, works like this:
1. Measure the length of the plain-text, $n$.
2. Multiply it by $128$.
3. Generate this much ($128·n$ bytes of) real rando... |
Where is the proof of security of Diffie's cipher? |
I have done quite a bit of Google searching and apparently the description of the algorithm along with its proof of security is detailed in [Contemporary cryptology: the science of information integrity](http://books.google.co.uk/books/about/Contemporary_cryptology.html?id=ONdQAAAAMAAJ&redir_esc=).
At this stage I h... |
There is an apparently a provably secure cipher that was proposed by Diffie, but enhanced by R.A. Rueppel. The scheme, which was mentioned in Applied Cryptography, works like this:
1. Measure the length of the plain-text, $n$.
2. Multiply it by $128$.
3. Generate this much ($128·n$ bytes of) real random data an... |
There is an apparently provably secure cipher that was proposed by Diffie, but enhanced by R.A. Rueppel. The scheme, which was mentioned in Applied Cryptography, works like this:
1. Measure the length of the plain-text, $n$.
2. Multiply it by $128$.
3. Generate this much ($128·n$ bytes of) real random data and ... |
All rounds of AES (and Rijndael) have a MixColumns step, save the last round which omits it. DES has a similar feature where the last round differs slightly. The rationale, if I recall correctly, was to "make the cipher appear similar in reverse as it does in the forward direction."
Why does this make AES$^{-1}$ l... |
Why is MixColumns omitted from the last round of AES? |
About **difficulty of insuring that $p-1$ is not smooth**: it is easy to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then test prime candidates $p=2 \cdot k \cdot p_1+1$, for consecutive $k$ such that $p$ is of app... |
In public key cryptography we can also use session keys which are symmetric. How do the sender (say a server) provides this session key information to its clients?
If the sender (here server) provides the session key by encrypting using its private key, all the clients (including a malicious one) can decrypt (using ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.