instruction
stringlengths
15
30k
I'm developing a authentication and authorization protocol for a Bluetooth device. The device should communicate with an Android app and needs to be able to authenticate the app during the connection phase. Some kind of secret or asymmetric pair is therefore needed to be shared by the app and the Bluetooth device. As ...
Determine LFSR phase quickly?
I know it's possible with work backwards from the output bits of an LFSR to determine its feedback polynomial in a O(n) fashion. I'm also curious if, given an LFSR state and polynomial, is it possible to quickly work out how far the LFSR state is from a given epoch state (eg: the all-ones state). The only sure-fire m...
Well, one way to look at this is to notice that, if the feedback polynomial is prime, then the result of starting with state $E$, and then stepping the LFSR forward $N$ steps is the value $2^N \cdot E$, where we do the computation in $GF(2^K)$, using the polynomial representation (with the feedback polynomial being the...
I remember I read that a MAC can be considered as a PRF. Can a variabe-length input keyed-PRF be considered as a MAC ?
*Note: A distributed signature scheme exists for RSA: [Practical Threshold Signatures, Victor Shoup][1]. <br> Is it possible to adapt such scheme for ECC?* A centralized signing machine is vulnerable to attackers -------------------------------------------------------- In the situation where a private key has...
The following was going through my brain for the past week. If my thoughts are generally known to the cryptographic community would someone provide a link or two. Even if I’m making a classic newbie mistake. Cryptographic internal functions operating like x=f(x) can be table lookup s boxes with the inverse s box as...
Math to replace s-boxes - Good or bad idea?
Being new to software development and crypto in general, I thought I would write a simple p2p encrypted chat app using the otr protocol detailed here: https://otr.cypherpunks.ca/Protocol-v3-4.0.0.html However, I am having an issue calculating g^x and g^y. I have g =2 for a particular 1536-bit prime, as the protoc...
The following was going through my brain for the past week. If my thoughts are generally known to the cryptographic community would someone provide a link or two. Even if I’m making a classic newbie mistake. Cryptographic internal functions operating like $x=f(x)$ can be table lookup s boxes with the inverse s box ...
I remember I read that a MAC can be considered as a PRF. Can a variable-length input keyed-PRF be considered as a MAC?
Is a keyed PRF a MAC?
I am currently gathering some test methods and test suites for random number generator qualities, and am a bit stuck at finding something feasible to test for n-dimensional equidistribution. As input I have an arbitrary amount of bits from that PRNG and a dimension N, and as output I want something like "I am reasonabl...
Is it possible to modify a homomorphic encryption scheme so that it can be CCA2 secure? From the definition of a homomorphic scheme, it seems that it is malleable, which would result in lack of CCA2 security. So, if we use the regular method to convert a CPA secure scheme to CCA2 secure scheme (using a hash of the me...
Can a homomorphic encryption scheme be made CCA2 Secure?
The S-boxes in quite many encryption algorithms (for example, in [AES][1]) have been *already* built with math (the AES S-box is an inversion function in $GF(256)$ plus an affine transformation). The lookup tables exist solely to ease the implementation. In fact, modern Intel/AMD CPU are already equipped with AES round...
The [Feistel cipher algorithm][1] produces a pseudorandom permutation with domain size equal to $2^{2m}$ (for some $m \in \mathbb{Z}^+$). That is, a one-to-one function $f$ of the set $\{0, 1, 2, \dots, 2^{2m} - 1\}$ onto itself. Furthermore, with so-called [unbalanced Feistel ciphers][2], it *may* be possible (tho...
The [Feistel cipher algorithm][1] produces a pseudorandom permutation with domain size equal to $2^{2m}$ (for some $m \in \mathbb{Z}^+$). That is, a one-to-one function $\pi$ of the set $\{0, 1, 2, \dots, 2^{2m} - 1\}$ onto itself. Furthermore, with so-called [unbalanced Feistel ciphers][2], it *may* be possible (t...
Yes. This is called format-preserving encryption. The most flexible algorithm is [FFX][1], which uses a Feistel network with AES-based round-functions, but performs addition modulo $m$. For certain values of $m$, the range of the round function is extended in order to limit statistical biases to negligible values. ...
I have a key that is the combination of two shorter keys generated by PBKDF2, which together are long more or less 64 bytes. Now I need to shrink it down to 32 bytes and I'm not sure what to use to do it. I was thinking of SHA256. I know that SHA256 is not safe to generate keys by itself, but since what I have is a com...
Is SHA256 good enough to shrink a key?
Short question: is there an algorithm for efficiently computing square roots in $\mathbb{F}_{2^n}$?
Can anybody show me (or point me to resource) how to generate public key and private key with simple math? Steps which can be reproduced in a simple calculator – so the message, keys all can be numbers for test. The values can be simple; it’s fine if it’s hackable. And how will you go about encrypting and decrypting t...
Is it mathematically possible to take a SHA256 hash and turn it into a 0-99 number where each number in 0-99 range is equally likely to be picked? As a 256 bit hash means the highest value possible is 2^256, this is not a nice or "round" number for the purposes of simplifying a hash down to ranges more natural for h...
SHA256 output to 0-99 number range?
I'm evaluating different hash algorithms for use in my application. One of the kind of algorithms I am looking at are cryptographically secure ones to protect against DOS attacks. SipHash seems pretty great, but the creators seem very careful to not call it "cryptographically secure". In [this paper][1] they call it "c...
Is SipHash cryptographically secure?
I am looking into using AES256-GCM for encrypting some database fields. I know that for AES256-CBC, I need to generate a new IV for each encrypt, but I can use the same key. The IV can be openly stored alongside the ciphertext (ie, it can be public). I started to read about GCM, but I don't quite understand some th...
I am looking into using AES256-GCM for encrypting some database fields. I know that for AES256-CBC, I need to generate a new IV for each encrypt, but I can use the same key. The IV can be openly stored alongside the ciphertext (ie, it can be public). I started to read about GCM, but I don't quite understand some th...
![enter image description here][1]So, I uploaded a text file in Cryptool and encrypted it with DES-ECB with the key FF FF FF FF FF FF FF FF. I encrypted the cipher text again, with DES-CBC using the same key. Next time, I encrypted the obtained text with DES-CBC. The first 8 characters matched the encypted text of ECB...
So, I uploaded a text file in Cryptool and encrypted it with DES-ECB with the key `FF FF FF FF FF FF FF FF`. I encrypted the cipher text again, with DES-CBC using the same key. Then, I encrypted the obtained text with DES-CBC again. The first 8 characters match the encrypted text of ECB. The rest of it is different...
Is it mathematically possible to take a SHA256 hash and turn it into a $0-99$ number where each number in $0-99$ range is equally likely to be picked? As a 256 bit hash means the highest value possible is $2^{256}$, this is not a nice or "round" number for the purposes of simplifying a hash down to ranges more natur...
If a user (other than the data owner) possesses the secret key in symmetric searchable encryption scheme are they able to run the trapdoor algorithm, or is this not publicly available?
In symmetric searchable encryption are the algorithms public?
Say we are able to decrypt a Elgamal ciphertext $c$ using only the public key. Apparantly it is now possible to solve the Diffie-Hellman problem (given $g^a, g^b$ calculate $g^{ab}$). How? I know how it works the otherway. When I'm able to solve DH, I found a way to decrypt Elgamal ciphertext. But I can't come up wi...
Since you're learning, I won't go ahead and give you the answer; I will try to point you in the right direction. Consider what Elgamal decryption is: if the private key is $a$ (and hence the public key is $g^a$), and you're given a ciphertext $(b, c)$, the ElGamal decryption is $b^{-a} \cdot c$ Now, assume that w...
The other day I saw this [Hybrid Cryptographic Algorithm][1] in the Google and felt curious about it. I am trying to understand this Hybrid Algorithm. And hopefully its not so hard to understand whats going on until AES portion comes up. Here in this research paper the author gives 48bytes input to AES and gets 88byte ...
I'm developing a client/server system in Java which is not interacting with third party software, so I don't have to worry about compatibility. At a certain point, I need the client and server to exchange a digitally signed value. I thought to use ECDSA, but I'm not sure what curve and what key length should I use. ...
I'm doing Matasano's challenges and struggling with second part of 49th problem where I'm asked to do the length extension attack with CBC-MAC without IV manipulation. There is a hint that I can simulate iv somehow to do this but I don't understand. Can someone drop me some hint atleast? I did the part with forging the...
consider the field F_2^4, defined by using polynomial representation with the irreducible polynomial f(x) = x^4 + x + 1. Given element g = (0010) as a generator for the field. How are the powers of g generated? What are the steps to generate the binary values of g0 to g15 as follows? g0 = (0001) g1 = (0010) g2 ...
consider the field $\mathbb{F}_{2^4}$, defined by using polynomial representation with the irreducible polynomial $f(x) = x^4 + x + 1$. Given element $g = (0010)$ as a generator for the field, How are the powers of g generated? What are the steps to generate the binary values of $g^0$ to $g^{15}$ as follows? $g^0...
How come that in various articles about pairings I never saw anybody mention that there is a possibility to turn Type 2 pairing into Type 1 by setting $e' : G_2 \times G_2 \rightarrow \mu, (P,Q) \mapsto e(Tr(P), Q)$, where $e : G_1 \times G_2 \rightarrow \mu$ is Type 2 pairing and $Tr$ is the trace map? The only dra...
Type 2 to Type 1 pairing transformation - why not considered?
Convergent encryption (CE), $E_k(d)$, is a way to encrypt the data $d$, with the characteristic that the encryption key $k$ is $k=h(d)$, where $h(\cdot)$ is a cryptographic hash function. Consider a cloud storage with client-side deduplication. The common procedures of uploading a file $d$ are to calculate and the s...
Convergent encryption has dictionary attack, but why hash function doesn't?
Comparing n-multiple amount of merkle trees?
I was going through the presentation slides on http://crypto.2013.rump.cr.yp.to/55e2988c4ed3c9f635c9a4c3f52fa0b1.pdf It summarizes the paper, Factoring RSA keys from certified smart cards: Coppersmith in the wild. In the last slide, it was mentioned that one possible future work to be done is to use the **Adi Shamir'...
Suppose you are implementing a Generalized Merkle Signature Scheme, using the Winternitz One-Time Signature Scheme for the node signatures. Furthermore, suppose the implementation is to be stateless (i.e. you don't keep track of which signatures have already been generated), meaning that you use a deterministic $Rand$ ...
There are two users $A$ and $B$ who are in different domain. Let's assume that $A\in KGC_1$ and $B\in KGC_2$. If they want to establish secure session, then they must run an identity-based authenticated key exchange protocol to get a shared secret key. To users, they can authenticate each other i.e $A$ is assured...
Suppose you are implementing a Generalized Merkle Signature Scheme, using the Winternitz One-Time Signature Scheme for the node signatures. Furthermore, suppose the implementation is to be stateless (i.e. you don't keep track of which signatures have already been generated), meaning that you use a deterministic $Rand$ ...
[SafeCurves][1] lists some ways to compare the security of elliptic curves. Their security criteria are split to "ECDLP security" and "ECC security". Failing the former basically means "there is no way to use this curve securely in general" while the latter "it is difficult to implement this curve securely". None of...
I am studying the RSA cryptosystem. The public key consists of $(n, e)$, the modulus (product of two large primes), and the encryption exponent. I want to separate the modulus $n$ and exponent $e$. A typical public key is expressed in base64, and is of the following type: -----BEGIN PUBLIC KEY----- MIGf...
The paper [Expressive, Efficient, and Revocable Data Access Control for Multi-Authority Cloud Storage](http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6620875&tag=1) contains the following simplification: >$$e(C_i,\text{GPK}_{uid})\cdot e(D_i, K_{\rho(i),uid})\cdot e({C'}_{i}, {K'}_{uid,aid_k}^{-\text{GSK'}_{ui...
The paper [Expressive, Efficient, and Revocable Data Access Control for Multi-Authority Cloud Storage](http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6620875&tag=1) contains the following simplification: >$$e(C_i,\text{GPK}_{uid})\cdot e(D_i, K_{\rho(i),uid})\cdot e({C'}_{i}, {K'}_{uid,aid_k}^{-\text{GSK'}_{ui...
spec here: https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#RandomSource-interface and: https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues How can the method be trusted? Or is it event trustworthy? Thanks
How does Web Cryptography API (eg window.crypto.getRandomValues) produce secure PRNG?
How does Web Cryptography API (eg window.crypto.getRandomValues) produce secure PRNG? Specifications: - https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#RandomSource-interface - https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues How can the method be trusted? O...
How does Web Cryptography API produce secure PRNG?
I plan to build my own crypto library. The project will be primarily for me to learn (and if useful for no other purpose, that is fine). In the past I have implemented a few hashes, and AES quite a few times while learning about it, but those projects were solely for me to learn, not for any field use. With this one I'...
I was going through [**these presentation slides**](http://crypto.2013.rump.cr.yp.to/55e2988c4ed3c9f635c9a4c3f52fa0b1.pdf) (PDF) on Crypto 2013. It summarizes the paper, Factoring RSA keys from certified smart cards: Coppersmith in the wild. In the last slide, it was mentioned that one possible future work to be...
I've been studying crypto for almost a year now, implementing algorithms, reading books, studying code, etc. The deeper I go in, the more I realize there is; I feel like I've just barely scratched the surface (if even that). Why do I start the word buffers in MD5 with those values specifically? What in the world mot...
About teachers I and others have suggested some teachers. But another approach would of course be to contact companies who work with cryptography (or analysis for that matter). Maybe both. I have no general knowledge about names, except for this award winning company: ***cryptomathic.com***. No, I don't have any eco...
I'm evaluating different hash algorithms for use in my application. One of the kind of algorithms I am looking at are cryptographically secure ones to protect against DOS attacks. SipHash seems pretty great, but the creators seem very careful to not call it "cryptographically secure". In [the SipHash paper][1] ...
> How does Web Cryptography API (eg window.crypto.getRandomValues) produce secure PRNG? Like the specification says: > Implementations should generate cryptographically random values using well-established cryptographic pseudo-random number generators seeded with high-quality entropy, such as from an operating-sy...
> Is there any advantage – other than potential memory or speed performance reasons – of picking a state size different from 512? If, what would the advantage(s) be? Yes. With 256-bit state, the main advantages are memory use and *hardware implementation area*. With 1024-bit state, a hardware implementation ca...
in the Mr Boneh's online course is stated the following theorem: > Let $G:K \to \{0,1\}^n$ be a PRG. > > **“Thm”**: if $\forall i \in \{0, … ,n-1\}$ the PRG $G$ is unpredictable at pos. $i$, then $G$ is a secure PRG. Moreover, according to his words, this is just a "puzzle" to prove, but actually I can't see i...
in the Mr Boneh's online course is stated the following theorem: > Let $G:K \to \{0,1\}^n$ be a PRG. > > **“Thm”**: if $\forall i \in \{0, … ,n-1\}$ the PRG $G$ is unpredictable at pos. $i$, > then $G$ is a secure PRG. Moreover, according to his words, proving this is just a "puzzle" to prove, but actually I...
Suppose you are implementing a Generalized Merkle Signature Scheme, using the Winternitz One-Time Signature Scheme for the node signatures. Furthermore, suppose the implementation is to be stateless (i.e. you don't keep track of which signatures have already been generated), meaning that you use a deterministic $Rand$ ...
Not all elliptic curves are safe to use for cryptography, especially from an ECC safety perspective. The site http://safecurves.cr.yp.to/index.html shows that two tested Brainpool curves, brainpoolP256t1 and brainpoolP384t1, are not ECC security safe even though they are ECDLP safe. Not all the Brainpool curves were ev...
Let $A$ be a finite field then the permutation $f_{(a,b)}(x) = a \times x + b$, where $a \ne 0; b \in A$ are uniformly distributed, is pair-wise independent. Thus, there are pair-wise independent permutations over $I_n$ (the permutations $f_{(a,b)}$ with operations over $GF(2^n)$. Can anybody explain how this is ...
How is this affine function a pair wise independent permutation ?
Let $I_n$ denotes the set of all n-bit strings, ${\{0,1\}}^n$. Let $A$ be a finite field then the permutation $f_{(a,b)}(x) = a \times x + b$, where $a \ne 0; b \in A$ are uniformly distributed, is pair-wise independent. Thus, there are pair-wise independent permutations over $I_n$ (the permutations $f_{(a,b)}$ wit...
How is this affine function a pair wise independent permutation?
I am getting to grips with cryptography as a total newbie, and am struggling with encryption "keys" and how to visualize them. From http://computer.howstuffworks.com/encryption.htm/printable: >Symmetric-key encryption is essentially the same as a secret code that each of the two computers must know in order to deco...
What exactly does a key do?
Can anybody explain how the below is true ? *Let $I_n$ denotes the set of all n-bit strings, ${\{0,1\}}^n$. Let $A$ be a finite field then the permutation $f_{(a,b)}(x) = a \times x + b$, where $a \ne 0; b \in A$ are uniformly distributed, is pair-wise independent. Thus, there are pair-wise independent permutati...
The other day when changing my password on a Solaris 10 system I was surprised that Solaris was able to detect that I hadn't changed enough characters between the new and current passwords. MINDIFF is the password security configuration parameter that specifies the minimum number of characters that need to be differ...
How does Solaris implement enforcement of “MINDIFF” if one-way hash is used for password protection?
When only using one-way hashing, is it possible to tell the number of characters changed between the old and new password?
Can anybody explain how the below is true ? > Let $I_n$ denotes the set of all n-bit strings, ${\{0,1\}}^n$. Let $A$ be a finite field then the permutation $f_{(a,b)}(x) = a \times x + b$, where $a \ne 0; b \in A$ are uniformly distributed, is pair-wise independent. Thus, there are pair-wise independent permutat...
Can anybody explain how the below is true ? > $I_n$ denotes the set of all n-bit strings, ${\{0,1\}}^n$.<br> > (..)<br> > Let $A$ be a finite field then the permutation $f_{(a,b)}(x) = a \cdot x + b$, where $a \ne 0; b \in A$ are uniformly distributed, is pair-wise independent. Thus, there are pair-wise indepen...
> When only using one-way hashing, is it possible to tell the number of characters changed between the old and new password? No. If the hash function is strong, even a single bit change will give a completely different hash. The only way to tell how many characters differ between a particular unknown hash value a...
Can anybody explain how the below is true ? > $I_n$ denotes the set of all n-bit strings, ${\{0,1\}}^n$.<br> > (..)<br> > Let $A$ be a finite field then the permutation $f_{(a,b)}(x) = a \cdot x + b$, where $a \ne 0; b \in A$ are uniformly distributed, is pair-wise independent. Thus, there are pair-wise indepen...
[Skein](http://www.skein-hash.info/) is defined for three different internal state sizes: 256 bits, 512 bits, and 1024 bits – with Skein-512 as the [“primary proposal”](https://www.schneier.com/skein.html). Is there any advantage – other than potential memory or speed performance reasons – of picking a state size d...
I'm developing a client/server system in Java which is not interacting with third party software, so I don't have to worry about compatibility. At a certain point, I need the client and server to exchange a digitally signed value. I thought to use ECDSA, but I'm not sure what curve and what key length should I use. ...
An [HMAC function][1] is designed to verify message integrity, i.e., that the message has not been tampered with. It is generally (always?) implemented by using a hashing function `H`, and calculating the hash `H(key + H(key + message)),` where `+` signifies concatentation ([Source][2]). The `key` is secret, and is reu...
Does adding a salt to the message before HMAC processing add any security?
I am getting to grips with cryptography as a total newbie, and am struggling with encryption "keys" and how to visualize them. From http://computer.howstuffworks.com/encryption.htm/printable: >Symmetric-key encryption is essentially the same as a secret code that each of the two computers must know in order to deco...
I am getting to grips with cryptography as a total newbie, and am struggling with encryption "keys" and how to visualize them. From http://computer.howstuffworks.com/encryption.htm/printable: >Symmetric-key encryption is essentially the same as a secret code that each of the two computers must know in order to deco...
> My question is: does it add any security to add a random salt to the message you are validating with HMAC? This depends on what the HMAC is used for. If you use a key to sign more than one *secret* message, a salt will prevent an attacker from knowing whether two of them are equal. (Or brute forcing a message i...
1)In the first step of key generation phase in Paillier cryptosystem given [here] It's given that ( length($p$) == length($q$) )$\implies$ gcd$(pq,(p-1(q-1)))$=1 where length($k$) = # bits in binary representation of $k$ gcd($a,b$)=greaterst common divisor of $a,b$ Give me a reference if proof fo...
1. Since $p$ and $q$ are primes, the only factors you needs to rule out are those two numbers. Suppose $p$ divides $(p-1)(q-1)$. Then it divides either $p-1$ (clearly not true) or $q-1$. The latter means $q-1 = p \cdot x$, for some $x \ge 1$ (if $x = 1$ either $p$ or $q$ is even, which is only possible if the num...
1. In the first step of key generation phase in Paillier cryptosystem given [here]. It's given that ( length($p$) == length($q$) )$\implies$ gcd$(pq,(p-1(q-1)))$=1 where length($k$) = # bits in binary representation of $k$ gcd($a,b$)=greatest common divisor of $a,b$ Give me a reference if pr...
1. Since $p$ and $q$ are primes, the only factors you needs to rule out are those two numbers. Suppose $p$ divides $(p-1)(q-1)$. Then it divides either $p-1$ (clearly not true) or $q-1$. The latter means $q-1 = p \cdot x$, for some $x \ge 2$ (if $x = 1$ either $p$ or $q$ is even, which is only possible if the num...
Suppose you are implementing a Generalized Merkle Signature Scheme, using the Winternitz One-Time Signature Scheme for the node signatures. Furthermore, suppose the implementation is to be stateless (i.e. you don't keep track of which signatures have already been generated), meaning that you use a deterministic $Rand$ ...
What is the computational time to break McEliece on a quantum computer ? I've seen thet polynomial time algorithms exist but for special conditions. What about the general case ?
> When only using one-way hashing, is it possible to tell the number of characters changed between the old and new password? No. If the hash function is strong, even a single bit change [will give][1] a completely different hash. The only way to tell how many characters differ between a particular unknown hash va...
I'd suggest that you clearly define which kind of Bluetooth device you are using, more specifically what its capabilities are with respect to processing power, etc. Another question, can you enter a number on a bluetooth device (e.g., for a PIN-based authentication, for example)? From what you're writing, I'd assume th...
I like to implement the *Rijndael's subBytes()* operation but using calculation instead of tables, because I like to play with this on different *wordsizes*, as an academical exercice, to see how the table would look like. The first part is a multiplicative inverse in the polynomial binary finite field, isn't it? Th...
How to calculate the Rijndael's SBox?