instruction
stringlengths
32
27.2k
Quantum crypto,lattice based crypto, Neurocryptography and cellular automata based cryptography are alternatives to number theory based crypto. I need to know what are the other hard problems like Lattice problems and Number theory based problems that can be used for cryptography(For asymmetric crypto).
In the the main post about MAC methods it mentions a few methods: Authenticate And Encrypt: The sender computes a MAC of the plaintext, encrypts the plaintext, and then appends the MAC to the ciphertext. Authenticate Then Encrypt: The sender computes a MAC of the plaintext, then encrypts both the plaintext and the MAC...
I would like to perform a dot product operation among $m$ parties using Shamir's $(m,m)$ secret sharing that is used for Secure Multiparty Computation. I am aware that Shamir's $(m,m)$ scheme is additively homomorphic, but can someone please provide an example of how I can use it for multiplicative homomorphism for SM...
There was a recent article about a new encryption technique that encrypts "using the time variations between two independent coupling functions". What is this technique they are referring to?
Authenticating a document means to verify it is from the sender. But it seems like signing a document also verifies it’s from the sender. What exactly is the relationship or difference between “authenticating a document” and “signing a document”? Are they the same thing?
I'm encrypting data with AES, using CryptoJS. CryptoJS returns an empty string in case the data couldn't be encrypted with the given passphrase. I'm not sure if this is intended, or happens in all libraries, but I need to know whether or not the data was decrypted successfully. The problem is this: if(decrypted == '') ...
I have implemented HKDF by myself and it seems to work good. I managed to replicate all the test vectors listed here but... except this one: Test with SHA-256 and longer inputs/outputs Hash = SHA-256 IKM = 0x000102030405060708090a0b0c0d0e0f 101112131415161718191a1b1c1d1e1f 202122232425262...
The Wikipedia article Trusted Timestamping states that we can timestamp data by publishing it's hash. Publishing can be done either independently or via a third-party publisher, as explained by DrLector on another thread. However, can we timestamp data without the capability to publish anything? What solutions can a pe...
We do compression in PGP. Does this step increase/decrease or either have any effect regarding the authentication of a message?
I am designing a system that uses TLS-like handshaking on a resource-constrained embedded system. I have settled on AES-CCM mode for symmetric session encryption and authentication, allowing encryption and MAC to use the same key. I would further like to combine the server write and client write keys into a single ke...
In Professor Boneh's online Cryptography course at Coursera, I am a little puzzled by his definition of a statistical test where he writes: A(x) = iff |#0(x) - #1(x)| <= 10.√n Now, if – as an example – we were to perform this test on a string of $100$ bits, then $10$ multiplied by the square root of $100$ is… $100$....
I am not rolling my own crypto or anything - just trying to learn about the Dos and Don'ts of cryptography: specifically about AES encryption and ways to generate keys for that. As far as I've understand, one of the options when creating cryptographically secure keys would be to gather entropy from /dev/urandom and the...
The Blum-Micali is a cryptographically secure pseudorandom number generator. The construction (from wikipedia): Let $p$ be an odd prime, and let $g$ be a primitive root modulo $p$. Let $x_0$ be a seed, and let $x_{i+1} = g^{x_i}\ \bmod{\ p}$. The $i$-th output of the algorithm is 1 if $x_i < \frac{p-1}{2}$. Otherwise...
I am aware that there are concerns if $p$ and $q$ are close i.e. $\Delta=|p-q|$ can't be too small. But I would like to know if there are any known attacks for cases where $p$ and $q$ take on different bit-sizes. (Don't mention extreme cases where the bit-size is close to the modulus.) Are there vulnerabilities? Can we...
I've implemented LibTomCrypt's version of fortuna and am wondering about the pool resetting after a reseed. In fortuna.c in libtomcrypt we have the following (which is that part that adds the entropy from the pools into the key), for (x = 0; x < LTC_FORTUNA_POOLS; x++) { if (x == 0 || ((prng->fortuna.reset_cnt >> (x-...
Fully Homomorphic Encryption (FHE) enables arbitrary functions computed on encrypted data, because it supports both addition and multiplication. But I wonder if FHE supports power operations. For example: $$C \leftarrow E(m)$$ $$y \leftarrow 2^C$$ $$2^m \leftarrow D(y)$$ I went over some FHE schemes like DGHV, it seem...
I have a hypothetical encryption scheme where somebody uses the one-time pad in CBC mode. That is, the block cipher is $E(k, m) :=k⊕m$, and that block cipher is used in CBC mode. Now, I am assuming that a message $m=m_1||m_2||m_3||m_4$ is used for encryption. How to compute $m_3⊕m_4$ from the resulting ciphertext (with...
What do you think of converting SpookyHash into semi-secure 192bit hash function by this way: increase security by using 8 * 8byte = 512bit blocks instead of 8 * 12byte blocks, but remaining 8 * 12byte = 768bit state (so that 256bit are used for "oracle") run more EndPartial rounds in End, to produce more entropy take...
In his paper Alternating Step Generator Controlled by de Bruijn Sequence, C.G. Günther states on page three that a de Bruijn sequence (..) can easily be obtained from an m-sequence (maximal length LFSR sequence) Unfortunately he gives no method for doing this in the paper, and I have been unable to find such a method...
I'm trying to find a special kind of Digital Signature Scheme. The scheme should allow me to transform a signature $s=\text{sign}(sk,m)$ (for a private key $sk$ and a message $m$) into a signature $s'=\text{sign}(x,m)$ (for another private key $x$ related to $sk$) such as given $s'$ nobody can state with high probabili...
I want to know what values are appropriate for the public exponent and certainty when generating an RSA Key (for example using Bouncy Castle RSAKeyGenerationParameters function). What is the significance of the the string to key count (s2kcount) which appears to be optional input for the BcPBESecretKeyEncryptorBuilder...
What is your opinion on this scheme: 1)get IV from CSPRNG 2)set 3 encryption keys k1,k2,k3 (3*key_lenght) (KDF/PBKDF) 3)Use 3 ciphers in CTR mode like this: The initial IV is encrypted using cipher1 with key k1 , then the iv is incremented and encrypted by using cipher 2 that uses the second key and so on, the output o...
i want to encrypt transparently using Rijndael. So this is, what I thought of and I would like to have an opinion from "Experts" whether this will harm encryption strenght. I am using chunks of 1MB and give them a GUID as filename. edit: The 1MB chunks are just out of performance reasons. Imagine a file of 500MB to de...
Chaocipher was invented by John F. Byrne in 1919. The algorithm was recently revealed – see Moshe Rubin's Chaocipher Revealed, the Algorithm (PDF). While a known plaintext attack successfully finds the keys, nobody has been able to put forward a general solution to this cipher. Is that possible?
Please note: this is purely a thought experiment and not intended for any real-world usage! I came up with a simple function $\mathrm{OPF}$ to map the integers $[0,C)$ (where $C$ is the "ChunkSize") to $512$-bit hashes such that for any $(a, b)$ $$a < b\iff \mathrm{OPF}(a) < \mathrm{OPF}(b)$$ I'm wondering why this is ...
The question came up here, which left me thinking: Is it possible to deduce the IV from CBC ciphered data, without knowing the key? And if not, why is it considered a bad idea to create an IV by, for example, filename$\oplus$Key, if you never store the IV? I know, that XOR is a no-go, when you are using ciphers, becaus...
Does anyone know about Locally Decodable Codes (LDCs)? It seems the private information retrieval schemes that based on LDCs are computationally efficent (answer a query without processing the whole database). Why LDCs receives little attention in cryptographic world?
Can anyone comment if the stream cipher described here is safe? The author claims it to be unbreakable, but does not provide any evidence or proof to support this. For completeness, I have reproduced the algorithm below. Encryption routine (Alice$\to$Bob) Calculates a shared secret: $s=$Curve25519(Alice_private_key, ...
Devise a scheme so that a message M can be shared among X, Y and Z in such a say that the only way of recovering the message is when X is present with either Y or Z. When X isn't present or each is alone, they will not be able to recover the shared secret. Additionally, generalize the above to devise a scheme so that a...
Here is the scenario: "SECRET" is a secret key that is kept private and only used in this one application. The application allows users to enter in any "VALUE" (within various open-ended limits such as numeric > 50, max length 20, etc... depending on the field) The application creates an HMAC-SHA2-256 "HASH" from VALU...
Let's say there are 100 choices (which are publicly known), each represented as a different string, and today you have to choose one of them. You need not reveal what that choice is right now, though. One thing you could do is take your choice, append a bunch of entropy at the end, and publish your signature of the res...
If I hash a keyword with SHA-512 and then feed the output as the key for the next round ....and keep repeating this process, will I gather a stream of random numbers?
This question was asked in comments on my answer to Should we MAC-then-encrypt or encrypt-then-MAC? I think posing the question as a separate entity is best, so: The general advice for applying MACs seems to be that we should encrypt first, then MAC. However, the general advice for signatures appears to be diametricall...
I'm trying to implement DES from scratch using the NIST paper and the Wikipedia article on DES. I got 16 round DES done, but I can't seem to get 8 round DES working. I figure it's because I got the rotation table wrong. The rotation table I'm using for the 16 round version is straight off of Wikipedia's DES Supplementa...
Key space is the set of all possible keys that can be used to generate a key. We using the number of valid key to describe it. I've given a hill cipher of block size $k$ over alphabet of size $p$, where $p$ is prime, how many keys there (valid key)? Since the hill cipher key is a $k$ x $k$ matrix, all the elements gett...
I recently came across a library that promises to do deterministic encryption with the following scheme: AES with 256 bit key in CBC mode with PKCS7 padding and Synthetic Initialization vector taken from the first 16 bytes of the HMACSHA256 mac of the plaintext. I use the same key for confidentiality and integrity. Ci...
I look for one-pass deniable authentication protocol with a short message payload for my project and find a solution: *Wei-Bin Lee, Chia Chun Wu, and Woei-Jiunn Tsaur. "A novel deniable authentication protocol using generalized ElGamal signature scheme." Inf. Sci.-177(6):1376-1381 (2007)* Unfortunately later I found a...
I am currently trying to implement a AES-256 cipher according to this sepcificaciton: http://techheap.packetizer.com/cryptography/encryption/spec.v36.pdf As well as on Wikipedia and in the document these offsets for the shift-rows operation are given (depending on the key size): Row 128 192 256 1 0 0 0 2 1...
I'm studying universal hash functions and have been reading several papers but now i'm focusing on Wegman and Carters original paper from 1979 (Universal classes of hash functions) and the H1 class. Choose a prime $p$ that is $p >= a$ Let $g$ be residue modulus $b$ ($g(x) = x \pmod b$) Then the $H1$ class is the set o...
I have been studying papers on various ways to crack the knapsack cryptosystem, unfortunately the mathematics in these papers involves lattices and LLL which is over my head. The paper "New Attacks for Knapsack Based Cryptosystems" may have a Sage example but I can't view the paper. http://www.math.ucsd.edu/~crypto/Pro...
We have a multiplicative cyclic group $G$ which is a subgroup of $(\mathbb{Z}/n\mathbb{Z})∗$. There are two parties, Alice and Bob: If: Alice knows: $b$ and $x$ such that $x^x = b$; Bob knows: $b$. Then what's the easiest non-interactive way Alice can prove to Bob the knowledge of $x$ without leaking $x$?
why is it recommended to write cryptography programs ,for example crypt-analysis projects with python programming language? what is the advantages of python? why not use c or any other language?
As I understand it elliptic curves are of the form $y^2 = x^3 + ax + b$ Where $a$ and $b$ are the curve parameters. However not all parameters will give a curve suitable for crypto purposes. Is there a known algorithm that can evaluate a pair of numbers $(a,b)$ and return YES if they are valid ECC parameters. Is this a...
Is it possible to design a protocol that by itself guarantees that a malicious implementation cannot leak secret data without breaking the protocol? Setting: Alice and Bob have a pre-shared secret key K. Using this key, Alice encrypts a bunch of plaintexts and sends them to Bob as a collection of files. The plaintexts...
I'm confused about /Friedman's method 2 (using a table with column of k size of key, and n/k rows, n is the total size for cipher text) \begin{equation} m = \Bigl(\varphi(l)-\varphi(o)\Bigr)/\Bigl(\varphi(T)-\varphi(o)\Bigr) \end{equation} P.S. $\varphi(l)$ - stands for index of coincidence for language $\varphi(T)$ ...
I've been doing some elliptic curve cryptography, and a library I'm using has this slightly bizarre algorithm for computing modular square roots: Let $x$ be some quadratic residue modulo $p$ for some large prime $p$. Let $h$ be some element of $\mathbb{Z} \setminus p\mathbb{Z}$ such that $h^2-4x$ has no square root mod...
I am trying to adapt the following function from SJCL, which does "AES-CCM" style CTR encryption, to do "pure CTR" encryption. I am playing around with SIV and would rather use this well-reviewed implementation rather than build my own CTR cipher from scratch. However, I'm having trouble understanding exactly what the ...
Perhaps a silly question, but I am wondering what the advantages are of threshold signatures. Let's consider the following two signature schemes: $(t,n)$-threshold signature with a trusted dealer, i.e. the dealer generates a public/private key pair, broadcasts the public key, and distributes shares of the private key...
Why the input cipher for AES encryption, can write in 4x4 matrix with 8 bits entires, and can said is 128bits? if each cell is 8bits in binary, how we said this matrix is represent 128bits?
I have a field $\mathbb F_{2^4}$, and it is represented as a residue ring of the polynomials over $\mathbb F_2$ modulo the polynomial $\beta^4 + \beta^3 + \beta^2 + \beta + 1$. I want to express each element in this field as a power of a primitive element $β+1$. My questions are: What are the elements of the fields? ...
As we know, RSA cryptosystem have both private key(a,p,q) and public key(b,n), by chinese remainder theorem and fermat's little theorem, we know that the importance of keep p and q secret, and from this Why is it important that phi(n) is kept a secret, in RSA post , we know $\phi$n need kept secret, but my question is,...
How can a cryptographic hash function be implemented/created using the block cipher? I was wondering if we can use AES in cipher block chaining mode to implement it.
Can a protocol proved secure in the standard model be considered secure in the random oracle model?
This question is a variant on Given a message and signature, find a public key that makes the signature valid, which discusses the analogous question for RSA. It was suggested to me by this post over on Bitcoin.SE. Suppose we are given an ECDSA signature $S$, a message $M_1$, and a public key $P_1$, such that $S$ is a...
Original Elgamal signature is defined $S(m, \alpha) = (r, s)$, where $$r = g^k \bmod p$$ $$s = (m – r\cdotα)k^{-1} \bmod (p – 1)$$ more information on Elgamal signature can be found here. Variant of a Elgamal signature scheme is defined as $$s = (r\cdot\alpha + k)m^{-1} \bmod (p-1) $$ I was stuck in the question t...
I'm reading Ferguson, Schneier, and Kouno's Cryptography Engineering, and it has a section on MACs. It discusses different types of MACs, but it seems to claim that to acheive 128-bit level security, you need a 256-bit MAC due to the birthday attack. Why is this the case? Why are collision attacks a concern in MACs? I ...
One-way accumulators are built upon a (quasi)-commutative one-way function. With quasi-commutativity, I refer to the following property: For $f : X \times Y \to X$, it is true that $f(f(x, y_1), y_2) = f(f(x, y_2), y_1)$. Although accumulators seem like a very useful cryptographic building block, I don't see them often...
As everybody knows in order to calculate HMAC we have to concatenate padding to the message. I am just curious why the padding needs to be fixed-length. Why do we need the blocksize parameter here? Why not use an arbitrary length key with arbitrary length 0x5c5c5c…5c, 0x363636…36? Why do we need to truncate the key whe...
Consider the El Gamal encryption scheme, a symmetric encryption scheme (KG,E,D), and the following hybrid encryption scheme having an encryption algorithm that, on input a public key (G,q,g,h), where h=g^x, returns (c1,c2). For which of the following c1,c2 values (and assuming a suitable definition of the key generatio...
RSA for Paranoids (RSAP) (in CryptoBytes v1n3), also known as Unbalanced RSA, is a variant of RSA proposed in 1995 by Adi Shamir, as a mean to increase the RSA public modulus size while keeping computation cost moderate. It is getting renewed interest, as part of a lightweight authentication and key agreement protocol ...
In Chapter 6, Question 6.8, of his book “Cryptography and Network Security Principles and Practices”, William Stalling asks: Why do some block cipher modes of operation only use encryption while others use both encryption and decryption? ECB and CBC use encryption function and decryption function while CFB, OFB and C...
For example: I have 3 plaintexts ($a$, $b$, $c$) and 4 keys ($K_1$, $K_2$, $K_3$, $K_4$), making a table map to the cipher text, key as row and plaintext as column $\begin{matrix} \ \ \ \ \ \ \ \ \ \ \ \ a\ \ \ \ b\ \ \ \ c\\ \\ K_1\ \ \ \ \ \ \ A\ \ \ C\ \ \ B\\ K_2\ \ \ \ \ \ \ B\ \ \ A\ \ \ C\\ K_3\ \ \ \ \ \ \ B\ \...
I read that TLS does PFS using Diffie Hellman. However, DH can be used even without certificates - so how is DHE-RSA better than plain DHE? Is DHE a insecure algorithm, that DHE-RSA is needed?
I'd be a noob in cryptography but reading up a little on RSA, I do get some understanding and I want to specifically resolve this issue. UPDATED Lets say we have the following values in place: KEYSIZE = 512 HASHSIZE = sha.digestsize*8 digest = some SHA 512 function We calculate the pub_key,pvt_key e,d via n = pq a...
I recently read questions about "MAC then Encrypt/Encrypt then MAC" which made me curious about how they actually use the algorithm. MAC only calculated once either case (according to what I read). However, in my experience surfing website via HTTPS, I think we should check the authenticity in every chunk of data recei...
For my cryptography class project in university I have selected Paillier Cryptosystem as a course project http://en.wikipedia.org/wiki/Paillier_cryptosystem#Key_generation In key generation it says Choose two large prime numbers $p$ and $q$ I have selected $p$ = 11 and $q$ = 17, it also satisfies the condition $gc...
Assume it is made a hash based on AES-256 encryption (perhaps because this is hardware-accelerated, but no standard hash is); and it is used the Merkle–Damgård structure, that is padding of the message into $n$ padded message blocks $M_i$ (appending to the message a 1, a minimal number of 0, and the 64-bit message leng...
I am implementing a key distribution protocol described by Torben Pedersen in A Threshold Cryptosystem without a Trusted Party (EUROCRYPT'91). In the protocol, the $n$ parties distribute a public key for the ElGamal cryptosystem, where each party ends up with "part of" the private key and can work together to decrypt a...
The definition of DH key exchange was given as the method let two authenticate each other & exchange the crypto key over an insecure channel. DH-key-exchange was innovated to defence man-in-the-middle attack, because hackers can not pretend the one you want to communicate without correct share key? or hacker don't know...
When I use the same 128-bit key for AES-128 and AES-256 with a known/public padding for the latter, is there some weakness in AES-256 that is not present in AES-128 with essentially the same key? This might be the case when I'm receiving the key from an algorithm which just doesn't produce enough bits (128 or less). ...
I found myself wondering today, how much security is lost if you take a plaintext - assume that its content, including any metadata is unknown to an attacker, for example it may be random data - and encrypt it with multiple keys (not chained) and give all resulting ciphertexts to an attacker, how much higher is the pro...
Suppose there is a secure PRF $F: K \times X \to Y$. Then is $F': X \times K \to Y$, defined by $F'(x,k):=F(k,x)$, a secure PRF? In my opinion it should be because exchanging the keyspace with the message space shouldn't effect the security. As we were choosing a random key from the key space, similarly we can choose...
RSA offers the functionality of encrypting (short messages, or symmetric keys) with a public key, and decrypting with a private key. However, RSA key generation is extremely expensive, especially for 2048-bit+ keys. Is there an algorithm which employs elliptic curve cryptography, fast asymmetric encryption, fast key ...
IKE Protocol have 2 modes, that modes have different structure. Does IKEv2 protocol have two modes like IKE.
I have found a Java implementation of AES CBC mode that runs in Netbeans. The lines below appear to create the key from password and salt: SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); KeySpec spec = new PBEKeySpec(password.toCharArray(), salt.getBytes(), 65536, 128); SecretKey tmp = fa...
I'm just looking at very simple encryption. I've noticed that the key is typically either at the front or at the back of the encrypted text. This is quite easy to break if you know the key. It can be made more difficult if the key is split up and scattered in random known positions within the encrypted message. The...
Can anyone explain the following text passage to me? Most real-world block ciphers build even permutations, because it's hard to build odd ones using small operations (32 bit) on larger (128 bit) block size. I don't understand the connection between parity of a permutation and small operations.
In other words, has there ever been a point in time in which having the content of a message has actually helped break a hash function?
I'm working with one-way accumulators, but I'm not knowledgable in cryptography. Is there an easy peasy way to hash numbers (or whatever) into prime numbers? Obviously I'd like it to be collision resistant and all that, but this project is huge, I'm alone and I'm confident someone else in the field will pick up from th...
Imagine a SSL-like protocol that instead of using certificates signed by a trusted CA, has the server's public key hard-coded in the client. My question is: what happens if the server's private key is compromised? Without certificates, the system doesn't have a CRL (Certificate Revocation List) and until the users upda...
Is there a map between the group of $\mathbb{Z}_{N^2}^*$ where $N$ is a composite number , a product of two equal size secure prime numbers $p$ and $q$ and a finite field $\mathbb{F}$, such that for all $x \in \mathbb{Z}_{N^2}^*$ there is a polynomial representation of $x \in \mathbb{F}$ ?
I am working on Du Atallah's multiplicative secret sharing scheme for more than 2 party scenario. Is anyone aware of its multiparty version (more than 2 parties). The paper for 2 party can be found in Section 4.1 of this link.
Suppose I have n hash/MAC functions, of which n-1 are extremely insecure, leaving only one that is in fact cryptographically secure. If I use all of them on a message and the XOR them together the result will be cryptographically secure or not? I believe it would, because if 1 is secure than it's output is undistinguis...
Referring to both Wikipedia page and ECDSA-cert paper I can understand that, given $\mathcal{E} = \mathcal{E}(a,\,b,\,\mathbb{F}_{2^m})$ as our elliptic curve on $\mathbb{F}_{2^m}$ group $G \in \mathcal{E}$ is a generator of the group, i.e. $\exists n: n\times G = O$ $n$ is the order of point $G$ with respect to th...
If we assume the strength of RSA is based on the difficulty of factoring (which I know we can't guarantee) and we compose the modulus of some other quadratic ring that is a unique factorization domain like the Gaussian integers, what is the resistance to attacks based on factoring with classical computing techniques? A...
I would like to understand how secure the permutation cipher is. I would specifically like to understand the following concrete setup: If the alphabet is $L = \{0,1,\dots , 255\}$ and $\sigma_1, \sigma_2, \dots, \sigma_n $ are permutations on $L$, then we can create a cipher by encrypting the first character in the pla...
I did work on the encryption algorithm and the decryption using the XOR method noticed that when more the key length, the less time spent on encryption and decryption. I have two questions in particular: Why the greater the key length less time? in encryption algorithms using the XOR. Is the key should be a certain...
Is ElGamal still unforgeable if the adversary knows the value of $r$ that was calculated by $g^k$? When we do sign the message $msg$, we calculate $r = g^k$. As we know, the regular ElGamal is existentially forgeable: $e$ is picked randomly from $\mathbb{Z}_{p-1}$ $r = g^e \cdot y$ mod $p$ and $s$ is $-r$ mod $p$ Whe...
Do Chosen-Chiphertext attacks (CCA-1/2) only apply to public-key Cryptosystem?
Are there any guidelines or justification for converting a stream cipher algorithm for use as a CSPRNG? For instance, lets say I wanted to convert one of the eStream portfolio Profile 1 (software) selections for use as a CSPRNG. What I could do is generate a really unique hash from some other algorithm and use it as t...
The symmetric cryptosystem one-time pad (OTP) seems to be very beautiful since it is perfectly secret according to Shannon. Many books, however, point out the main drawback: one must create a secret key the same length as the plaintext. For this reason, the concept of perfect secrecy has these days been abandoned, and ...
If I have a private key of (43, 341). What would be the steps I need to take to decrypt a small message using RSA? I have looked online and everything seems very confusing. Any tips or advice would be helpful. I have gotten this far: p=31 q=11 p*q=341 O(n)=(31-1)(11-1)=300 e=7 (43*e)%300=1 e=7 public key (e,n) (7,34...
I am trying to understand why the constants differ in this SHA1 implementation: https://code.google.com/p/crypto-js/source/browse/tags/3.1.2/src/sha1.js this._hash = new WordArray.init([ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]); https://code.google.com/p/google-authenticator/source/br...
I just learned about the basics of public cryptography a few weeks ago and I am curious as to why the C rand() function should not be used for crypto schemes. For example, say I want to generate a private key using the C rand() function, along with srand(). Lets say srand() generates a seed based on system time (as in ...
Let's say I have fileA and fileB, both encrypted somehow, but in the same method with different keys. If I xor them together, they will make a repeating pattern of 32 bytes length. What does that say about the repeating pattern, the encryption pattern, and the likelihood of the unencrypted files to be identical? Is the...
I wrote a simple python script to preform one time pad encryption I would like to be able to decrypt the ciphertext by hand. In my script I use mod 26. This is how I was shown to calculate a mod using a calculator: 467%26 = 25 467/26 = 17.9615... 17*26=442 467-442=25 I used this code to preform the one time pad in m...
I've been working on a project that will require secure communication over the internet, so I've been thinking of TLS 1.2. After looking around I chose Botan but then I thought about using a more common one, OpenSSL. But since Heartbleed I've been reading quite a bit about problems with OpenSSL, and it seems to be rath...
It's still common to come across implementations of KDF1 and KDF2. Basically these are KDF's that simply derive multiple keys from the key seed and a counter: $K_i = \operatorname{KDF}(K_{master}, i) = \operatorname{H}(K_{master} | c)$ In this function $|$ means concatenation and $c$ is the encoded value of $i$ in 4 by...
I have been looking at the scrypt hashing algorithm and am confused as to why the N value, which determines the overall cost, is limited to powers of two. There are only 3 things that the N value actually affects The amount of times to mix with salsa (via two loops with N being the count) The amount of memory required...
The usual definition of MAC security is (roughly) that there is no "efficient" adversary that has non-negligible advantage in the "MAC game" where the MAC game is as follows: the challenger chooses a random key, the adversary sends some messages to the challenger, the challenger sends the MACs of those messages with th...