instruction stringlengths 33 27.2k |
|---|
Is it ok to create and store the hash (unkeyed hash function) of a plaintext before encryption or does it lead to vulnerabilities?
If it is ok are there requirements for the used hash function and encryption algorithm?
Important to mention is that the hash should not be used for integrity checks or something like that.... |
I've been using asymmetric-time bijective functions (or permutations) for several practical uses. I've applied them to solve problems in software-attestation and proof of unique blockchain storage.
An asymmetric-time permutation is basically a public permutation F that takes a lot of time to perform in one direction (e... |
How can I calculate the real size of key in a CP-ABE scheme. For example, I have this GSWV scheme:
Fuchun Guo, Willy Susilo, Duncan Wong, Vijay Varadharajan: CP-ABE with constant-size keys for lightweight devices.
In both papers I have that $\mathbb{G}_1=160$ bits and $\mathbb{G}_2=512$ bits, and length of decryption ... |
When I calculate two RSA keys, what if anything, would make any difference which I call the public vs which I call the private key?
|
What is the effect of the birthday bound on the security of AES-GCM, when a very large number of messages are encrypted?
I am looking for attacks that are useful in obtaining information about the plaintext and/or creating forgeries, not just distinguishers.
|
Assume AES gets a devastating attack making it unusable. Is it possible to use RSA in a secure way that can encrypt data in bulk?
I can't see how RSA (assuming OAEP padding) can be used in normal block cipher modes. Its output is likely not pseudorandom, so it can't be used in CTR, OFB, or CFB mode. Its output is too... |
I would like to know if there are any known attacks, besides from side-channel attacks (differential fault attack, correlation power analysis, template attack), against MICKEY 2.0 or MICKEY-128 2.0.
I already did a deep research on the web using several scientific databases, but I did not found anything besides the abo... |
I'm new in cryptography and there are a couple of things that i'm not sure if i understand correctly.
First, when using padding (PKCS or OAEP), if the chiphertext has errors in transmission we'll we always get an error at the decyption process? Will it detect all errors, or is there a possibility that a certain combina... |
For the last couple of days, I have been learning a bit about encrypting data in PHP, as I need a good encryption/decryption function for storing users' passwords in a DB. I use openssl_random_pseudo_bytes() for the IV, hash_hmac with SHA256 and openssl_encrypt(). Here's the function for encryption:
// 32 bytes (256-bi... |
I have a device, HASP, which has functionality to encrypt 8 byte data using 3DES in ECB mode, with three different keys, I am interested how secure is this?
I know it might not be most secure, but how much? Attacker may query HASP to encrypt something, and try to bruteforce keys from this?
Idea is I thought if I need C... |
For example, User tries to access a.example.com and server presents abc.example.com with a.example.com not in SANs list.
Will it be just a warning or an error?
|
When creating gpg subkeys, the master key signs and certifies that a subkey belongs to that master. That's ok, but, can master key decrypt something encrypted by a subkey? I guess no, but I want to be 100% sure. Am I right or I misunderstood?
|
To my understanding, there are two "approaches" to t out of n threshold encryption. In both of them, n shares are given to different shareholders, and at least t of them must agree to "proceed". "Proceed" can take two different meanings: either the shares are the input to derive a secret that can be used to perform a t... |
IMHO the main essence of a Feistel cipher of block length $n$ is the working of a non-linear function $F$ that is applied to the two halves of the block of length $n/2$.
Now suppose a certain block cipher of block length $n$ as well as two keys of it are given. If one employs the given block cipher in the sense of $F$ ... |
Most encryption softwares don't seem to have a trial limit. So why would a hacker need to crack the key, or even need to know the salt value, if he can just brute force the 6-8 digit password?
|
Let's say I'm given a specific SHA-256 hash.
Further assume that the SHA-256 input, that yielded this hash contained a known sub-string.
Is there a way to find the input (containing the specific substring) that hashes to the given output?
If so, is it possible to further find an input of length N (containing the substr... |
I know that it is possible to define RSA over elliptic curves just as DSA and Diffie-Hellman have been. I know that it doesn't offer much of a speed advantage, but does it at least reduce the size of the keys?
|
The comments in this recent question about the security of 3DES made me wonder if the key complement property of DES (which reduces its security by ~1 bit) can be used in the meet-in-the-middle attack on 3DES.
Can the complexity of the attack be reduced by 1-2 bits by making use of the complement property to rule out m... |
Interested in password cracking, I thought of a concept for lookup tables that can tell if a hash can be created using a dictionary in about O(log n) time.
A simple overview of the idea is a follows: Store the first x bytes of every hash created with the word list, using unique values, sorted. When encountering a new h... |
This comment from Reddit math, in response to a statement about how people can communicate secrets to each other with a third party listening, has a very small, simple example of public key cryptography:
Take your message, treat it as a number and multiply it by a bunch of primes.
Send it to me. I will then multiply b... |
First up: this is not a decoding request or anything. This is about terminology.
Twice per year, we email another department to ask for a new licence file for their software. They are always slow to reply. The licence files are encrypted, but I noticed only a couple of characters change between revisions. My 'home-grow... |
I found from a book the following proof.
Although I understand the initial construction, I don't understand the last sentence that proves the statement.
Why $f(f(x))$, in the paper $h(h(x))$, is always equal to $0^{2n}$
Is this what they are saying?
Why is it clearly not a one way function?
|
I am trying to prove that a function is a one-way function.
The function I am working on in particular is $f'(x,y)=f(x)||f(x \oplus y)$.
For what I have understood looking at similar solved solutions (e.g. 1c), the strategy is the following:
Assume $f'$ is not one way, so exists an $A'$ that can invert $f'$ with non-n... |
First up: I am not asking you to decypher anything. This question is about attacking a Playfair cipher; more specifically – how to create potential grids when doing so.
I'm currently working on a message in playfair cipher text. The issue is there is no grid, and only potential crib is attack. I was told there is a key... |
As I understand it, ChaCha20 is slower than AES-CTR in hardware. Are there any hardware-optimized stream ciphers?
|
I'm trying to do Fiat Shamir but with $I = S^3 \pmod n$ where $S$ is the secret key. How will I prove that I know the cube root? I tried doing the old formula but with instead with $(RS)^3 = x*I \pmod n$ where $R$ is the random number and $x = R^2 \pmod n$, but it didn't seem to yield the correct values. Só what formul... |
I'm talking about HDCP v1.x. The specification is a too dense for me and easy-to-understand information about it on the net is scarce.
What I've gathered is:
that there is a master key that is a 40-by-40 matrix of 56-bit values.
each device that is part of the HDCP ecosystem has a unique array of 40 secret keys genera... |
I'm thinking about designing my own container file format that allows me to store a file in it along with, say, a thumbnail or other metadata. Some of these files are confidential and therefore must be encrypted. Basically, my goal is to achieve confidentiality, authenticity, and integrity for my file containers. But, ... |
The exact definition of security for a pseudorandom permutation is straightforward - for some encryption scheme $E\,\colon\,\mathcal{K}\times\mathcal{D}\rightarrow\mathcal{D}$, it must be the case that no efficient adversary can distinguish $E_k(\cdot)$ from $\Pi(\cdot)$ (a random permutation on $\mathcal{D}$) except w... |
I am wondering if the following is a useful misuse-resistant authenticated encryption scheme:
Parameters (shared by many users):
Choose a hash function $H$, such as Blake2 or Keccak. SHA2 could also be used.
Choose a stream cipher $E$, such as ChaCha20 and AES in CTR mode.
Inputs
Up to a large amount of associated ... |
It is known that there is a protocol that is secure in the random oracle model, but where any real hash function makes the protocol insecure. The proof is constructive, but I could not understand the protocol in question.
Could someone explain the protocol in language that is easier for a programmer to understand?
|
I know next to nothing about cryptography, which is bad because I'm a programmer. I was exploring some code the other day and the encryption part of it seemed a little strange to me. I'd like the name/terminology/links to this algorithm/concept so I can learn more about it, and I'd also like to know if it's secure or a... |
I have read this paper (pdf) which talks about measuring the entropy of thermal noise collected from camera input. They estimate the minimum entropy at about 4 bits per pixel. Probably estimating 1 bit per color looks to be the safest option from looking at the X500's camera:
The paper mentions some future research wo... |
Are checksums basically toned-down versions of cryptographic hashes? As in: they are supposed to detect errors that occur naturally/randomly as opposed to being designed to prevent a knowledgeable attacker's meticulous engineering feature?
So, essentially they are non-secure versions of cryptographic hashes, one could ... |
Using any non square root discriminant $D$, we should be able to find the Weber class polynomial. How can I convert the roots of a Weber polynomial to a Hilbert class polynomial over modulo prime?
|
The definition of the one way function says:
it must be verifiable in polynomial time
probability of inverting it less or equal to negligible
Now, I am not sure I fully understand one way functions.
Can I say that $f(x) = x$ is a one way function?
Do we assume that we know how $f$ is defined?
if $x$ is of length $l$... |
I would like to know what the standard is for two-pass, nonce-misuse-resistant AEAD that is efficient in software. Thus, AES-SIV is excluded; modes based on a stream cipher like ChaCha20 are preferred.
|
I am writing regarding a certain ransomware program called cryptowall (prop 4.0).
I have lost many documents to this, and as it so happens, I have a few file duplicates before and after they were forcefully encrypted.
My question is whether or not it is possible for someone knowledgeable to figure out the key used and... |
Is there any practical difference from using HMAC-SHA1(key, msg) vs SHA1(key + msg) as a way to verify the authenticity/integrity of a certain message? Note that the plus sign means string concatenation in this context
Am I losing out on some esoteric detail that the HMAC-SHA1 offers in terms of mathematical immunity t... |
According to NIST SP800-108, there are three modes that can build KDF from PRF: counter mode, feedback mode and double-pipeline iteration mode. Assume that the same PRF and input distribution are used, will the three different modes make any difference on security strength of the resulting KDF? Here the security streng... |
Normally, it is necessary to use authenticated encryption if the message may be tampered with. Can the authentecation be omitted if the message has been otherwise authenticated?
|
ChaCha20 is considered 256-bit secure (no attack faster than brute force). However, the best known cryptanalysis that I know of is on ChaCha7.
That gives ChaCha20 a rather large security margin (much larger than, say, AES-256). Is ChaCha12 still considered to be 256-bit secure (as in "considered usable when top perfo... |
Why can't NORX produce intermediate auth tags like Keyak can? Keyak appears quite attractive because of this, but seems to be slow in the absence of hardware acceleration.
|
Consider XSalsa20-Poly1305-SIV. This is obtained by:
computing a MAC $t_{secret}$ of the plaintext from the key and nonce, as in ChaCha20-Poly1305 except that the plaintext, not the ciphertext, is MAC'd.
compute $t = F(K,t_{secret})$, where F is the ChaCha20 core (or any other PRF).
use $t$ as the auth tag and as par... |
Does XChaCha20 (built from ChaCha20 just like XSalsa20 is built from Salsa20) exist and have XSalsa20's desirable properties?
|
Does length-prepending stop length-extension attacks on Merkle-Damgård hash functions, assuming that the length is checked?
|
In the ideal/real proof paradigm we sometimes find simulators with the capacity of set adversary random tape.
My question: when do we have to consider the necessity of simulators set adversary random-tape?. We know that malicious adversary can substitute random-tape setup by whatever he want, but: are there cases where... |
My cryptology professor asked us to show that while the following signature scheme is conceptually valid, that it is inherently insecure, however, I am not sure how to demonstrate that the associated verification process produces an equality if the signature is valid.
The protocol works as follows given:
A publicly sh... |
What is the order and cofactor of a base point?
Is it possible to deduct the order and cofactor, given just the basepoint.
What about the other way around from order and cofactor to basepoint?
|
I'm making a small python program to encrypt an arbitrary text file.
Currently I have a file to store passwords (hashed values), so nothing stored in plaintext. The user enters the command line arguments of a flag '-e' or '-d' to encrypt or decrypt, and a filename and a password. The password to encrypt is different to... |
I am following the notes "Introduction to Modern Cryptography" by Bellare and Rogaway, and on the chapter about blockciphers there is the following claim (page 11 of https://cseweb.ucsd.edu/~mihir/cse207/w-bc.pdf):
2DES, although having the same effective key length as 3DES2 and offering what appears to be the same o... |
Is it okay to bail out early when length mismatch is detected?
Specifically, when verifying authenticated encryption, is it okay to bail out early if the wrong amount of ciphertext or the wrong amount of associated data is given?
As I understand it, these two are generally public quantities, and so this does not result... |
Suppose I apply a PRF to a secure MAC. Do I still have a secure MAC?
|
In the Wikipedia article on Diffie-Hellman, the algorithm calls for a large prime modulus, $p$, and a generator, $g$, which is a primitive root of $p$.
As far as my knowledge of number theory goes, to find a primitive root of a prime number, you first need to determine the prime factors of $\phi(p)$, or $p-1$.
Obviousl... |
The following questions are of pure theoretical nature. I don't have an application in mind.
Is there a key that makes AES the identity function?
Is there a key that makes AES the identity function for certain
inputs?
Is it known whether such keys might exist?
Are such keys known for other ciphers?
For example, I wan... |
I'm implementing ECDSA for NIST P-256 curve. I just want to know if the same implementation will also work for SECP curves? If it doesn't, can you point me to one or more references of algorithms for SECP 256?
To clarify: I specifically want to know if there are any differences in algorithms for point addition and poin... |
I'd like to use a possibly insecure cache for storing expensive-to-calculate sensitive information. My requirements are:
If the cache ever gets compromised it should reveal nothing about its ids or values (except for the number of records/size of the database).
If both the client and the cache are compromised, but not... |
What are the reasons because of which ChaCha20 is immune to timing attacks ? Also why is not AES immune to timing attacks?
|
In the algorithm(link), for calculated n and chosen secret key s, we need to calculate $\sqrt[s]{p_{i}} \bmod p $.
As an example in original research paper (link) , For a given $p=9700247$ and $s=5642069$, It is given that $\sqrt[s]{2} \bmod p = 8567078 , \sqrt[s]{3} \bmod p = 5509479$ and so on.
So how to calculate ... |
For a long time I've been under the impression that all of encryption uses xor at its basic level.
Is this true? What other method could be used to encrypt plaintext with a key? Asymmetrically, as while as symmetrically?
There are hundreds of ciphers, aes, blowfish, ect. They are all different, but do they all rely on ... |
What's the effective key length of Two-Key Triple-DES, for some (possibly several) reasonably well-defined and sensible definitions of effective key length, say assuming attack using ample chosen plaintext?
A sensible definition of effective key length (in bits) of a block cipher under some attack assumptions could be:... |
What advantages does HS1-SIV have over ChaCha20-Poly1305-SIV?
I know that both use the ChaCha stream cipher, but I am trying to understand why HS1-Hash is a better MAC.
Edit: To hide the Poly1305 result I would use of the ChaCha20 core, a.k.a. HChaCha20, as a nonce-free but keyed PRF. This works because ChaCha20 is re... |
Probability density function of gaussian distribution is
$$ 1/{\sqrt{2 \pi} \sigma} \times {e^{{(x-c)^2/ 2{\sigma}^2 }}} $$
in lattices we assume $$ \sigma =s/\sqrt{2 \pi} $$so the gaussian function becomes
For $$X \in R^n$$ $$\rho_s(X)=1/s^n \times e^{-{\pi}||(x-c||)^2/s^2}$$ but it is given as
$$\rho_s(X)= e^{-... |
I am reading over a slide that I found online regarding the DES algorithm for encryption and I am a little confused about the per round key generation. From the slide below, I understand that each per round key is obtained by shifting left either 1 or 2 bits depending on the round. The thing I do not understand is the ... |
Lets suppose Alice send to Bob a message $M$ along with its hash value say $H$ which is calculated using SHA3 algorithm. It is sent on the network where it got read by Eve and she does not make any changes to the message $M$, she will just read the message.
How Bob will come to know that the message has been read, if t... |
I am having trouble coming up with a use case for RSA or DSA. It appears that ECC is better in every way.
Is this true?
I am looking for cases where RSA/DSA is superior to ECC, not where it is used for historical reasons.
|
I'm given a public key. Using openssl rsa ..... I got the public key has the exponent as 3. When I calculated the size of the ciphertext, it is 8 bits smaller than the 2048-bit modulus.
How can I decrypt RSA provided I only have public key and ciphertext?
Let me know if you want the files.
|
AES MixColumns is done by multiplying a $4 \times 4$ matrix and a column of the AES state (a vector). Addition and multiplication are done in $\operatorname{GF}(2^8)$.
In the paper White-box AES, the authors use $32 \times 32$ matrix $\mathit{MC}$ times a $32 \times 1$ vector over $\operatorname{GF}(2)$.
My question is... |
Universal reencryption is an interesting encryption primitive. Attempts to build signatures schemes or protocols with authentication incorporating it have frequently failed though.
A plausible application of a signature scheme employing universal reencryption might be:
Alice's software obtains a blind signed creden... |
Codebook appears, if I don't err, to be an antiquitated topic rarely touched upon in discussions of modern cryptography. Couldn't codebook nonetheless be of high practical utility and even be extremely advantageous in certain critical fields of modern secret communications? Consider e.g. the hypothetical situation wher... |
I'm reading an article about authenticated encryption and don't understand some inputs to an encryption function. They are associated data, public and secret message numbers. Can you explain me their meanings?
|
Long ago, I read an article on Wikipedia which described a cipher algorithm, used by the KGB (if I remember well), with the property that all ciphered letters had the same (or nearly the same) probability to appear, without adding symbols to the alphabet of the ciphered text (i.e. unlike how homophonic encryption does)... |
Attempting to use openssl to create a signature is confusing on several levels:
If I'm using it to sign a hash that I've already created (HMAC-SHA-384-192, specifically),
a. why must I specify another hash algorithm?
b. What algorithm is consistent with the one in the HMAC and ECDSA-384?
Why does the signature size va... |
Suppose I have the values $a$, $b$, and $V = H(a) \oplus H(b)$ with inputs $a \neq b$ and $H$ being SHA-224. None of these values are a secret.
How secure is it to assume that no other possible values $a'$ and $b'$ (except the case of $a'=b$ and $b'=a$) can be generated that result in the same $V = H(a') \oplus H(b')$?... |
From WAR10CK here:
If I actually do create a machine using RC4 or AES-CTR and have a TRNG continually feed it a constant steady stream of random bits. Provided that the stream of bits is purged after every message, will it meet the perfect secrecy requirement for a OTP?
|
I am new in the cryptography and the information security problems, I try to understand things as much as I can and I know it's really complicated in the beginning.
Considering the communication protocol between a bank and its machines is standard and we have got an opponent who knows a little bit the way the informati... |
How is differential cryptanalysis used to attack hash functions? I've been struggling through a couple academic papers and thesis's on the subject but they all sound like greek to me. Does anyone know who to explain this in simple enough (layish) terms?
I get how differential cryptanalysis methods work (a few of them)... |
Disclaimer: I'm a beginner to cryptography.
Background: I'm reading Cryptography Engineering by Ferguson, Schneier, and Kohno, where the authors use this image:
Question: What do the commas mean here?
My attempt: m, c := --- seems to mean "given" m, c equals ...
|
Suppose that one performs (for example) AES-GCM encryption and decryption using an algorithm that is vulnerable to timing attacks, but each key is used only once. Is it still possible to perform a successful timing attack?
|
Suppose that I use Blowfish or XTEA (both secure block ciphers with 64-bit block size) in CTR mode.
In these cases, I need to change the key after $2^{16}$ blocks to avoid leaking information with probability less than $2^{-32}$.
However, suppose that I make a mistake and use the key to encrypt a $2^{33}$-block ($2^{36... |
I'm trying to get my hands on the key that OpenSSL uses for a DES encryption. The key is based off a random number generator with a seed taken as parameter.
The code used is below, provided as part of my assignment. I'd like to get my hands on DES_cblock key both for debugging and to understand how the OpenSSL works. A... |
I am not a cryptographer, nor do I claim to be.
However, at times I have wanted to contribute to open source cryptography projects such as libsodium. The maintainer of libsodium is a cryptographer, and I consider it a good assumption that they will review any code submitted to the repo.
Under these conditions, is it o... |
It doesn't have be using a truly random key, (it could be the Enigma) but the attack must be based on XORing two parts of ciphertext.
|
I have 2 set of public/private keys. I would like to know how I can calculate DHKey.
e.g:
P-192
Private A: 07915f86918ddc27005df1d6cf0c142b625ed2eff4a518ff
Private B: 1e636ca790b50f68f15d8dbe86244e309211d635de00e16d
Public A(x): 15207009984421a6586f9fc3fe7e4329d2809ea51125f8ed
Public A(y): b09d42b81bc5bd009f79e4b59... |
Disclaimer: I'm new to cryptography.
Background: I'm reading Cryptography Engineering by Ferguson, Schneier, and Kohno, where, in Chapter 2, the authors write this:
Question: What is $k(k-1)/2$ called? It seems related to an arithmetic sequence $a_n = a_1 + (n-1)d$ and some kind of combination (my notes below), but I... |
Elliptic curve cryptography is much more secure for the same parameters because attacks that work on the DLP do not work on the ECDLP. Why do the attacks fail in the latter case?
|
As far as I know, WPA2 authentication consists of a 4-way handshake. The first message is from the AP, containing the ANounce, a random number generated by the AP, The second message is from the client, containing the SNounce concatenated with a MIC of the ANounce, the third is from the AP containing the GTK concatenat... |
Is the following snippet from a recently published cryptography book correct?
EDIT: Expand the snippet from the book to make the context (symmetric key search) more clear.
You can apply this to other cryptographic issues as well. Let's return to the DES algorithm. Recall that it has 72,057,594,037,927,936 possible ke... |
I have been browsing for the fastest and most efficient modular reduction algorithms and came across quite a few.
But the one in A Fast Modular Reduction Method (2014) by Zhengjun Cao, Ruizhong Wei and Xiaodong Lin is the fastest that I could find. This implementation is based on look-up-table.
Is this the fastest algo... |
Are named curve parameters always the same? I know this may be a stupid question however I think this is the case. For example the secp256r1 is defined in this documet http://www.secg.org/SEC2-Ver-1.0.pdf.
|
I'm reading an article about authenticated encryption algorithm - PAEQ.
It uses a permutation function AESQ, which has transormations from AES. And there is written about MegaSBoxes, which contain 4 rounds of AES transformation. So, there are 1 active MegaSBox in 4 rounds and 5 active MegaSBox in 8 rounds (because of b... |
In this paper, the definitions are simply as follows.
Multi-Level secret sharing: Higher level participants can help lower participants to get the secret.
Compartmented secret sharing: Each level participants has to get its own secret. (No help from higher level participants)
According to this paper
I found that Disjun... |
I was wondering if using a salt with a hash is more effective than hashing and encrypting your hash.
|
To allow the key to be more easily remembered.
Example:
To encrypt a hard drive without having a remember a key with 128 bits of entropy.
From what I find they seem mostly used to hash passwords so the password database is more resistant to brute force in the case it's compromised. (compared to using a regular hash fun... |
so I'm reading everywhere that the Pollard Rho for Dlog's complexity of $g^a \pmod{n}$ is $\mathcal O(\sqrt{n})$.
Shouldn't it be $\mathcal{O}(\sqrt{q})$ with $q$ the order of $g$?
|
This is the situation:
I have a list of hashes where each hash is always the SHA-256 of the one above it.
If I keep going down the list it must at some point loop since there can only be $16^{64}$ possible SHA-256 hashes.
So at some point the hash I get has already been in the list before.
The problem is that the algor... |
What is it about the architecture of GPG that requires me to enter the password of the secret key when I export it with "gpg --export-secret-keys"?
I would expect that gpg can just copy the relevant part out of the keyring and dump it into a file, without a password prompt. After all, the exported form is still encrypt... |
Myself and some fellow students are doing some "Independent Security Research" on campus and trying to crack the campus paid parking system to better understand how it might work.
The system works like this:
You pull a ticket with a mag stripe upon entering
When leaving, you take your ticket to a pay station, it reads... |
I'm working on a project that uses OAuth. In the OAuth RFC it says many times that communication between the authentication server and the client should be with the use of TLS. However, in the project I'm looking at that uses OAuth, they say that the channels they use are only authenticated, not confidential. When look... |
Here is arc4random.c from the LibreSSL pseudorandom generator as used in OpenBSD.
It works as follows:
Take 40 "truly random" bytes from OS (PRG seed);
Use the seed as key and IV to generate 1024 bytes of ChaCha keystream;
Use the last 984 bytes of the keystream as a PRG output, and the first 40 bytes as the key and I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.