# All Questions

12 views

### Should I calculate two CMACs over two different strings that share common bytes?

I am trying to secure my RF communication in which one RF package consists of two separate segments. I need to make sure that one segment of one packet is not replaced with a valid segment of some ...
27 views

### Reversing DJB2 Hashes

I have some spare time, and a few hundred DJB2-hashed values sitting around. I thought I'd try to do something "useful" and invert DJB2, such that I could calculate the plaintext of the hashes (which ...
42 views

### Probability that two different files can have same MD5 hash for both an unencrypted and encrypted version (AES256, same key between files)

This math is way over my head, and don't even know if it can be done, but here are the assumptions: Take unencrypted File [Fu] of variable length, but assume 100KB as an example. Let File [Fe] be ...
31 views

### Key Derivation from Random Seed

I would like to generate a key which would be good enough to be used for encryption with AES in a mobile environment. My idea is to use as a seed ''random attributes'' from a mobile device. Is hashing ...
49 views

### Is complexity of ElGamal cryptosystem $O(log(n))$?

ElGamal cryptography is $y=g^d \mod p$ having complexity $O(log(p))$. $C1= g^r\mod p$ and similarly $C2$ and the decryption has same complexity of $O(log(p))$. So can we say that the total complexity ...
60 views

### Elliptic curve group over a prime finite field $F_p$

If $p$ is a big prime, and the elliptic curve $E$ is defined over $F_p$ by the equation $y^2=x^3+ax+b$ where $a,b\in F_p$. The point on $E/F_p$ together with the infinite point $\mathcal{O}$ form a ...
68 views

### Does 3-DES take approximately the same time to encrypt 1B and 1KB?

I am using 3-DES to encrypt some data in Java. I decided to run some tests and plot some graphics to decide how to optimally pack data for its encryption (see how encryption/decryption time behave ...
39 views

### Where is the OID and ASN.1 specified for AES_CMAC?

I have a requirement to implement AES_CMAC as the authentication algorithm in a CMS library. I just can't seem to find the OID and the ASN.1 definition for it. I expected to see the OID under ...
63 views

### Vigenère cipher: Security when key length and plaintext length are the same

I have read the Vigenère cipher is secure as long as the key length is the same as the length of the data to be ciphered. Is this true in cases where the same key is used multiple times. In that case ...
67 views

### Adding an IV to an AES implementation

I have an embedded project that requires AES, I seem to have found an AES implementation that fits the bill here: http://www.literatecode.com/aes256, but it does not include an IV. Are there any ...
79 views

388 views

### How does rolling code works?

I have general questions regarding rolling codes. Basically there is a sender and a reciever. Both have a sequence generator. The reciever checks if the recieved sequence matches the newly generated. ...
53 views

### Universal hashing techniques based on matrix multiplication

The article here says below, about a universal hashing technique based on matrix multiplications. "However, there is a little known method based on using a random matrix. It has lots of advantages - ...
95 views

### Rainbow table for DES with all-zero plaintext?

Consider the function $F$ from $\{0,1\}^{56}$ to $\{0,1\}^{64}$, mapping the operative bits of a DES key to the ciphertext for all-zero plaintext. How could we organize a rainbow table to invert that ...
43 views

### Textbook RSA with exponent e=3 [duplicate]

I remember $e=3$ is a bad choice for textbook RSA. But I can't really recall why. What happens if I choose $e=3$? Can I retrieve the message by simply calculating $\sqrt[3]{c}$? Why can't I do that ...
50 views

### Different padding rules for Merkle-Damgard and Keccak/sponge function

We learned that length padding was used in Merkle-Damgard where after padding with zeros another block is added that contains the initial length of the input. This is supposed to prevent same hash ...
73 views

### Secure way to store fixed size string of digits

I need to store a string of digits (0-9) of a fixed size in my database securely. I've already performed a rainbow table attack on a plain hash, and it broke it in a matter of seconds. One option I ...
98 views

### Which algorithm do you recommend for practical use to generate unique passwords for each website?

So, in my imagination there is this simple algorithm with only one master password, let's say a prime number 'p', which I have to remember. Using only the address of the website and p, the algorithm ...
38 views

### Calculating periodicity of a pseudo random number generator (Middle-square method) [on hold]

Below is a Python code that calculates the periodicity of the middle-square method for a given 4 digit-numbers: ...
153 views

### Why is MAC using nonce+message+hash(nonce+message+identifier) not the standard?

Given that we know that nonce + message + hash(nonce + message + mac-key) all inside the encryption makes it possible to detect if any bits of the message have been ...
55 views

### How can I solve this modular equation? [on hold]

I want to know what's the most efficient way to solve following equation: $5 \times x \mod{13} = 2\\ x = ?$ This is just an example. I am looking for a way to solve any equation of this kind.
558 views

### RSA with modulus n=p²q

I've been wondering what would happen if the RSA modulus would be $n=p^2q$ instead of $n=pq$. I feel like there is an obvious security flaw (as there is with most modifications). Would this choise of ...
123 views

### MAC using a modified CBC mode of operation

I'd like to know whether the following modified CBC-MAC is secure (given a fixed IV). Source: an old course on Network Security Are there some obvious attacks I can't see?
55 views

### Is my implementation of a PRG at least intuitively secure?

I've devised a PRG using Bezier curves , constructed with Bernstein polynomials, and I was wondering if you guys could help me with some suggestions or constructive criticism. Basicly I take a random ...
122 views

47 views

### Publicly Verifiable Authenticator

I am working on a Block Storage system, where I have the need to encrypt and authenticate blocks by a client, but also want the server to be able to detect bit corruption while minimizing the work ...
96 views

### Lowest number challenge scheme

Suppose Alice knows a secret number $a$, and Bob knows a secret number $b$. Is there a simple way for Alice and Bob to know who has the lowest number, without Alice & Bob exchanging their numbers ...
24 views

### Validity of authentication scheme?

Here's an authentication scheme I had in mind that combines the simplicity of HTTP Digest Authentication and the security of real crypto primitives. I have in mind the user-level authentication, ie ...
37 views

### Different Diversify key, every time with AES-CMAC [on hold]

I am using the following code and class to generate a diversify key from AES_CMAC. The doFinal method returns different key every time given the input and masterKey are constants. Any suggestion would ...
38 views

### PGP message integrity : How can receiver of an email check the integrity using the sender's public key?

PGP message integrity: Basically, only private key can decrypt message encrypted with public key. But in the message integrity service in PGP does the reverse, where the Hash of the message if ...
303 views

### How do we operate IV+1?

This may be a very simple question, but I have not found info about this in any place. My question is about CTR mode: When it says $IV+1$… How do we make this operation? For example, if I have the IV ...
74 views

### Use AES-256 Or AES-CTR-256 For One Block?

I am have one block of data to encrypt that is 32-bytes long. Is it better to use the AES-256 primitive for this single block (not a stream) or AES-256-CTR, and also would there be any cons or pros to ...
57 views

### understanding the proof of knowledge

Recently I've been reading the paper “A New Family of Implicitly Authenticated Diffie-Hellman Protocols”. It's very hard for me to go further. Especially when it comes to the proof of knowledge. ...
37 views

### AES multiple devices to server communication

I have multiple devices connecting to a server, whose communication needs to be encrypted. At the moment I have an AES library doing the job (possibly inadequately): I am using a database of keys on ...
45 views

### How much bit encryption is this DES code using? [closed]

I am a newbie to cryptography, I got this code from a site and understood how it is working. It is using in built Java's cryptography library to encrypt and decrypt files. I just wanted to know how ...
234 views

### Is there a generic attack on encrypted CRC32 when used as a MAC?

I am examining a protocol that uses CRC32 as a MAC (see note 1) the weaknesses of this method but I would nevertheless like to see if it is just weak or actually relatively easily to break. The ...
49 views

### AES-CTR-256 Sub Keys With Encrypted Sub Key Index

I was working with some encryption and I decided to put a spin. To preface this would be used to encrypt multiple files. You start with a key file generated from random data. For example you could ...
22 views

### How to create new PGP key? [closed]

I'm using GNU GPG. I want to replace my old keypair with a new one, and I have a couple of specific questions as I haven't done this before! My keyring currently contains both the new and old ...
104 views

### Allowing multiple password reset tokens, and a question on random number predictability

I have a few requirements for a password reset system, along with some questions at the end as to its security. Requirements The aim is to provide a password reset mechanism satisfying the following ...
187 views

### Security equivalent to Diffie–Hellman problem?

I've been doing the security proof for one of my Theorem. Basically, given $g^a$, $g^b$, $g^{cb}$, $g$ and $c$ as known values. Is the problem of computing $g^{acb^{-1}}$ equivalent to the Diffie ...
28 views

### Video encryption at server, decryption on mobile using AES [closed]

There are lots of videos which I'm encryption in PHP server. Now users play them on phone. So basically decryption on phone and playing. I'm targeting Android, iOS, blackberry, windows phone. ...
120 views

### Spoofing protocol nonce

Amy and Betty have a shared key $k$, and the protocol below is to provide a mutual authentication for both Betty and Amy. A sends B : $n_a$ B sends A : $n_b \;\|\; E(k, n_a)$ A sends B : $E(k, n_b)$ ...
93 views

### Rate my idea: is that a stronger GPG-like algorithm?

I came up with a simple idea but I don't know if it is really secure or not. I know that you shouldn't create any algorithm on your own. I'm just curious, that's all. Algorithm explanation: First ...
33 views

### Process of dividing 168bit key into 56bit keys in TripleDES

I used TripleDES so many times but never thought about this. In TripleDES it requires 168bit ...
73 views

### Cryptolocker 2.0 ransomed #1.23 btc [closed]

I have just received a screen capture of the malware. It turns out it's ransoming \$not BTC. The ransom demands \$750 to be payed in full within ~ hours. The English is broken and many of the ...
65 views

### Turning PRPs in PRGs with a counter

I am following the Coursera Cryptography I course and I have the following question, I am a bit perplexed by the statement, in week 2 lecture "What are block cyphers?" that a counter-mode PRF is a ...
49 views

### Sectors of small data encryption [closed]

This may not sound a straight cryptography question and I'm also not sure where to ask or whether its the correct place to ask. Well, I really want to know is there any sector/workplace/software of ...
58 views

### Can a EC private key be derived from a public key?

I understand that the public key does not expose the private key. That is not the question. The question is: Given a EC public key, can a different, but plausible and functional private key be ...