# All Questions

606 views

### How does blocksize affect security?

I have recently read about how blockciphers and how stream ciphers work, and although I think I finally got everything right, I'm still wondering how increasing blocksize increases security.
117 views

### Cryptography survey as an undergrad

Is cryptography so specialized that taking a survey class is a waste of time? I'm not the type of person who can do logs in my head or has a deep mathematical aptitude, but cryptography is certainly ...
163 views

### Unable to understand hash function representations

I have some hash function representations, which I find it hard to understand. I have searched a lot but didn't found anything helpful. Please help me understand the hash function representations ...
199 views

### Is it possible to choose which point will have the public key of a given Elliptic Curve?

I am wondering if there is a feasible way that, given a specific elliptic curve (such as secp256r1), I could create a keypair where the public key has a given $x$-coordinate. If it is not possible, is ...
370 views

### Is there a way to systematically calculate the public exponent $e$ in RSA?

I'm learning RSA in one of my classes and we were given a problem: $p = 5$, $q = 11$ I have done the following steps: $n = 5 \cdot 11 = 55$ $\phi = (5-1)\cdot(11-1) = 40$ I know that to ...
696 views

### How to perform frequency analysis of a substitution cipher using a Base64 alphabet

Let's imagine a cipher that works like the following: Plaintext is encoded to Base64. The characters in the encoded plaintext are substituted with a randomly shuffled character set(A-z, 0-9, -, _, =)...
175 views

### Does a stream cipher require a KDF when it's key is variable length?

RC4 has a variable length key. Is it still necessary to use a key derivation function, such as PBKDF2, to initialize it? Would using a single character password weaken it's output when compared to a ...
840 views

### Theoretical attack on RSA

The high security of RSA is granted, because it is very hard to factorize $$N = p * q$$ Nevertheless, there is actually no need of factorizing $N$, in order to generate the $Private$ $Key$, but the ...
226 views

### Diffie-Hellman insecure on addition modulo $n$

Assume that the group $G$ is the set $\mathbb{Z}_{n} = \{0,\ldots, n-1\}$ for a 1024 bit integer and $+$ is addition modulo $n$. Then why would Diffie-Hellman key exchange in this group be insecure?
603 views

### RSA performance

I was wondering what is the performance bottleneck in RSA algorithm? Is it the size of message, calculating the modular inverse, exponentiation? Say I have a fixed value of n to encrypt and decrypt ...
818 views

### Is there a cryptographic method to add noise to a plaintext instead of actually encrypting it?

I'm looking for a cryptographic technique that instead of permuting a cleartext, would add noise to the cleartext to obfuscate the true text among a bunch of garbage. For example, a list of 10 ...
3k views

### What happens when a root CA has its private key compromised?

What happens when a root CA has its private key compromised? Then all children in the tree are compromised too? And then all certificates are compromised? What needs to happen then? Related: - How ...
979 views

### random access stream cipher

Some time ago I was working in a pet project for a type of database engine. And I thought about securing the data in disk with encryption.. and since the main code was already developed.. I had a few ...
11k views

### Difference between linear cryptanalysis and differential cryptanalysis

What is the main difference between linear cryptanalysis and differential cryptanalysis? For example in relation to DES?
538 views

### Finite fields and ECC

I understand modular arithmetic(or at least I think I do!) and I've tried to read and learn about how the Math in RSA works(and I think it went pretty well). I've been reading up on ECC and it looks ...
515 views

### Map Bytes to Number

Using node.js crypto library I can generate cryptographically strong bytes. How can I use this to generate a random number between 0 and 9999 (both inclusive)?
3k views

### Why is RSA encryption significantly faster than decryption?

I am designing an implementation of RSA . I recorded computation times in Java by using System.currentTimeMillis(). It returned an encryption time of 0.05 ms and ...
234 views

### Can the encryption exponent e be greater than ϕ(N)?

So I was just wondering in RSA, can the encryption exponent e be greater than ϕ(N)?? For an examples sake, lets just say N = 707, so p = 101 & q = 7. So, we have ϕ(707) = 600. Can I have e = 707?...
755 views

### Calculating cycles per byte

Cycles per byte seems to be a critical concern in designing and choosing stream ciphers. For example, from Wikipedia, RC4 has 7 cycles/byte on original Pentium chips. How is this calculated? Do they ...
3k views

### How to perform file encryption using 128-Bit AES?

I am confused, how can I encrypt a file using 128 Bit Advanced Encryption Standard? Do I need only to encrypt the file name and it's content or is there something that I need to do to encrypt it? Is ...
2k views

### Why do all hash functions use big-endian data?

I've looked at several hash function specifications, and they all emphasize the need for big-endian byte ordering. Is there a reason for this that has to do with security, or is it simply convention?
697 views

### Are there public slow-but-strong algorithms out there that resist brute-force attacks better?

I'm reading that AES uses 4x4 bytes (4*4*8 = 256 bits key) matrix for performances matters (since it's a requirement for common standard encryption algorithms), but are there implementations with ...
64 views

### Why DES s-box non-linear? Why it makes the cracking of the cypher more difficult?

I know that if we have a cypher which makes only linear transformations (let's say a bunch of $XOR$'s), we break it simply writing a system of equations with $\oplus$ operation starting from the ...
68 views

### How to meter and limit number of files encrypted?

First my apologies if this isn't the right forum for this but here's my problem : I have a black box that takes an input file and produces an output file. I want to sell this black box to a customer ...
67 views

### Insecure third party connection

My organization processes some PII data and shares it with an outbound connection (outflow only) that is a third party. The data transfer transactions occur without human intervention. That outbound ...
195 views

### Should I use XTS or GCM to encrypt my hard drives?

I want to start encrypting all of my hard drives, but I don't know whether to choose XTS or GCM mode. Why is it that XTS is recommended (since the most websites I visit use GCM in their HTTPS ...
96 views

### GCM: use the same key:IV pair to encrypt file and filename

Using Java, I wrote a piece of code that encrypts a given file with AES in GCM mode of operation. So far nothing uncommon. Now I would also like to encrypt the filename, in the following way: ...
308 views

### RSA: Recover e given factorization of N and plaintext/ciphertext pair

Is there a way to recover the public exponent e (assume in this case it is in fact not public) used in an encryption if I know the following: Factorization of <...
703 views

### Is AES solvable by reducing to SAT?

Consider a known plaintext attack on AES — just so we have an actual system of equalities that we can feed to a SAT solver. Is AES solvable in this way? In other words, will the algorithm eventually ...
238 views

### Constant time multiplicative inverse within a word

I was playing with an algorithm which at one step, calculated $f(x) = x^{-1} \mod p$ for $0 < x < p = 2^{64}-59$ (note $p$ is a prime). I used Knuth's Vol 2 Algorithm X algorithm for calculating ...
100 views

### How can there be AES-256-GCM, when GCM is defined for 128-sized blocks?

In both node.js and OpenSSL, I am seeing cipher "aes-256-gcm". However, in NIST Special Publication 800-38D, that defines GCM, I am reading: The underlying block cipher shall be approved, the ...
216 views

### Does complicating a flawed algorithm make it secure?

It's a basic question I guess, but I don't know the answer and I don't think that anyone asked it. Suppose I built a system, it relies on MD5 for security, suddenly I read am article on how easy are ...
697 views

### Is it usual for a signed message to contain the public key of the signer?

In protocols/systems which use ECDSA, is it common for the message to contain the public key of the message signer? If not, how do recipients know that the message has been signed by the correct ...
422 views

### Are all possible EC private keys valid?

I usually generate a key pair using openssl or Bouncy Castle. I'm using curve secp256k1. The 256bit private keys look fairly random. Do all values of "private ...
513 views

### Is it safe to reuse a symmetric key when using asymmetric encryption?

I've written a C# Library that I hope will be used for security purposes in a commercial application. The application will communicate through the internet and not on an internal network. I am using ...
160 views

### Combine two sha512 hashes to a single hash

Assume I have two data fragments: $Frag_1$ and $Frag_2$. I can build sha512 hashes the usual way with $SHA512(Frag_1)$ and $SHA512(Frag_2)$ and then hash the two fragments appended to each other: ...
128 views

### Is it OK to use a hash of the key as nonce for AES GCM?

I don't see an immediate risk of using the hash of the key as the nonce for AES GCM. Is there something I could be overlooking?
253 views

### How is information disclosed by modular multiplication?

Consider the case that $c = a \cdot b \mod p$ where $p$ is a known prime and $0 < a < p$ and $0 < b < p$ are unknown integers numbers. Furthermore, some bits on the value of $c$ are ...
409 views

### Fast PKI for embedded device

We are creating a device with a small microcontroller (20 MHz CPU 16 KiB RAM). We need some way to securely send signed files to device (only signature, no encryption necessary). An external company ...
221 views

### What, cryptographically speaking, is a “long message”?

I have read about long message attacks on some cryptographic hash functions. However, I don't quite understand what is being referred to as a "long message". Also, do long message attacks only apply ...
259 views

### SRP-6 vulnerabilities when N is small

I'm one of the developers of an application which uses SRP-6 as the authentication mechanism. The authentication part of the code is very old and uses N with only 256 bits (all arithmetic is done in ...
393 views

### Security issues of a MAC-then-Encrypt-then-MAC approach?

Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity. What comes to mind is ...
390 views

### Effective security of block cipher – equal the key size, or half the key size?

The Wikipedia “Key Size” article states: The security of an algorithm cannot exceed its key length (since any algorithm can be cracked by brute force), but it can be smaller. … … … Most symmetric-...
2k views

### What curve and key length to use in ECDSA with BouncyCastle

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 ...
201 views

I was researching about hash, and I thought, If sites store passwords with hash algorithms, then can't this happen: User A has the password 'hello' User B finds out the hash code of the password of ...
417 views

### Avoiding overflow when encrypting with RSA

When encrypting with RSA one calculates $m^e \pmod n$ by doing the following: m^e % n Where $m$ is what we encrypt. Often $e$ is a very big number to make it ...
266 views

### Can you really insert the text you want in one-time pad?

The Wikipedia article "One-time pad ~ Authentication" says : For example, an attacker who knows that the message contains "meet jane and me tomorrow at three thirty pm" at a particular point can ...
1k views

### random number generator 10-side dice alternative

A lot of sites (e.g. Dirk Rijmenants') refer to 10-side dice to generate random number for one-time-pad. I was thinking about new ways to generate random numbers, letters and passwords. here what I ...