instruction
stringlengths
32
27.2k
When it's considered, like here a project where a user needs to store a (small piece of data) on a blockchain what does that really mean from a cryptographer's perspective? What security guarantees does it give? Things like availability (to which entity, under what condition and delay, with selection according to wha...
So basically i have a set of float data, its value ranges from -1.3117 to 1.7956 and then i convert this data into 64 bit binary value(assuming it is originally 64 bit double float). After that, i convert it into 64 bit integer. I encrypt this data with an encryption algorithm. The cipher histogram shows the distributi...
I'm an electrical engineering student and was doing a brief research regarding the round transformations of the AES-128 and came across the Wikipedia article describing the generation of the substitution box (https://en.wikipedia.org/wiki/Rijndael_S-box) from the mathematical point of view. In the corresponding article...
For 256 bits "Double-and-add" multiplication uses about 128 addings and 256 doublings, where "Montgomery ladder" uses near 256 addings and 256 doublings. "Double-and-add" in my Intel(R) Core(TM) i3-8130U CPU @ 2.20GHz takes 0.02 s, it is normal or too big? In adding we compute $\lambda = \frac{y_q - y_p}{x_q - x_p}$. M...
Linked question: AES encrypting multiple files With a password, I have 100k files to encrypt. (Maybe 100k files today; or maybe 50k today, 10k tomorrow, and 40k files the next week). Up to now, I did this (pseudo-code): for each file: plaintext = file.read() nonce = getrandom(bytes=16) key = KDF_PBKDF2(pa...
I have the polynomial ring $R = \mathbb{Z}[X]/(X^N - 1)$ with $N = 11$ and $h \in R$ with \begin{equation*} h = 7 -11X - 7X^2 -12X^3 + 8X^4 - 11X^5 + -8X^6 + 11X^7 - 4X^8 + 2X^9 + 3X^{10} \end{equation*} Now I want to find the polynomial $u$ such that \begin{equation*} u\cdot h + v\cdot (X^N - 1) \equiv X - 1 \ (\textr...
Can anyone give me some documentation on the various format preserving encryption modes?
My question is rather practical and specific. I am trying to setup an efficient CKKS scheme in Palisade. To this end, the automatic choice for secure parameters has to be turned off and I rely on the LWE estimator which estimates the security of an LWE instance. Now, the estimator provides a security estimation for an ...
This paper introduces 'Freestyle' a randomized, and variable round version of the ChaCha cipher. It uses the concept of hash based halting condition, where a decryption attempt with an incorrect key is likely to take longer time to halt. It works on the following principle: a sender encrypts a block of message using a...
For curve secp256k1 prime modulus is $2^{256}-2^{32}-977$ and order is smaller number but has near half of starting bits set. If I draw number to be private key, it must be less than order. All field operations are modulo prime modulus and it means they must be smaller than modulus but can be >= order? (or not?). Coor...
While I am a front-end developer and not a security expert programmer, I am worry about the keys I am using for my AES && RSA encryption. Please help me to understand: Is the following keys are secure ? Is the following keys are performant and fast ? I don't have any IV, is it good still without it ? If IV is good and...
Distance-bounding algorithms are a classical solution for the Relay Attack, wherein a verifier can determine an upper bound on its distance from the prover. However, recent literature is discussing the concept of mutual distance-bounding, where both sides of a transaction can measure this upper bound, to overcome the r...
I was just wondering why this kind of algorithm can't be used instead of, say, Diffie-Hellman to exchange keys: Alice decides on a key she wishes to share with Bob. Alice generates a stream of bytes with the same length as the key (securely, say, with a CSPRNG). Alice sends to Bob: C1 = (key ^ alice_random_bytes) Bo...
Please pardon my question if it seems silly, but I am very keen on knowing: in applied cryptography, there is such a thing as a one-way function, which given an input would generate an output that is unique for that input. Discrete logarithms and factorials are, as far as my knowledge goes, necessary to create one-way ...
Are there any problems for which we have known lower bounds? For example, for comparison based sorting, we know you need $\Omega(n \log n)$ comparisons. Edit: I'm aware that this requires restricting the algorithm to comparisons. I couldn't think of any lower bound in an unrestricted model, but I'm mostly interested in...
The definition of a function $F:\ \{0,1\}^n\times\{0,1\}^n\to\{0,1\}^n$ being a Pseudo Random Function Family (PRF) is that it's implementable by a P.P.T. algorithm $\mathcal F$, and there is no P.P.T. algorithm $\mathcal A$ able to distinguish $x\mapsto F(k,x)$ from a random function for unknown random $k$ and non-van...
For the elliptic curve with equation $y^2 = x^3 + x + 0 \pmod{13}$ in the finite field, how are all the points in this curve calculated. See the image below for an example created via https://graui.de/code/elliptic2/. The above images shows 20 points. How are the coordinates of these points calculated?
Suppose a bunch of software entities are participating in a wide-area broadcast network (the network carries a lot of traffic, and the software entities also participate in those conversations, so their transmissions are likely to be seen by friend and foe alike). How can they find each other efficiently and establish...
I understand that the ring setting of an Enigma rotor changes the alignment between the internal wiring and the letters on the ring. For example, in the diagram below, rotor I has ring setting 2 (B), which causes current entering at position A (the center) to flow through the wiring from Z to J (internal positions) whi...
I am creating a Binary Neural Network that encrypts payloads and I would like to compare it to AES in quality, for example: With BNN you would need XX years to decrypt where with AES would take YY years. How can I do that?? Currently, I have two tests: A graphic representation that shows how random the payload is, lik...
These are hash functions, but I don't understand their notations, can anyone tell me what's the difference between H, H1 and H2? $\mathbb{G}_1$ is an additive group and $\mathbb{G}_2$ is a multiplicative group. Both groups have the same prime order p and their bilinear mapping is $e: \mathbb{G}_1 \times \mathbb{G}_1 \t...
We need find y for some x on elliptical curve in cases: decompressing public key restoring public key from signature for given message hash, r and s. This algorithm uses power twice: first it is y1 = $x^3$ modulo p, and next is very high degree y = $y1^{(p + 1) / 4}$ modulo p. I know way to compute it on logarithmic ...
For the elliptic curve y^2 = x^3+2x+2 mod(23), why is it necessary that 23 is a prime. Why is the elliptic curve y^2 = x^3+2x+2 mod(24) not suitable for elliptic curve cryptography?
As described in RFC 8017, RSASSA-PKCS1-V1_5 uses the following bytes during the encoding process : 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 Does anybody know how to compute these values?
I am trying to finish a paper on censorship resistant data-sharing systems in semi-centralized ways. I know the below threat model can be mitigated by using decentralized system, but I am looking for a possible theoretic solution for the following, without being able to change the rules. Consider the following threat m...
I read here that assuming we have a Fiat-Shamir (FS) signature $\Sigma$ that is secure based on the hardness of a particular hard problem $\Pi$. Then, the security proof of $\Sigma$ in the classical ROM indicates that the reduction algorithm can break the underlying problem $\Pi$ with advantage $Q^{-1} \cdot \epsilon^2...
We have two bit strings $x\in\{0,1\}^q$ , $y\in\{0,1\}^w$ of length $q$ bits, and $w$ bits. The notation $x\mathbin\|y$ means $(q+w)$ bits long concatenation, And the functions: $H∶\ \{0,1\}^* \to \{0,1\}^n$ and $F∶\ \{0,1\}^* \to \{0,1\}^{n+6}$ defined in terms of $H$ as $$F(x) = 000\mathbin\|H(1\mathbin\|x)\mathbin...
I recently implemented an algorithm written in Python that was using the XTEA encryption method. Are there any more reliable algorithms than the XTEA , regarding to memory usage and PSNR ratio ,other than integrity, which do not encounter drastic degradation of image and fulfill the requirements of a imperceptibility ...
In my understanding, RSA-sig authentication only requires its own Public Key so that the peer authenticates it using Root CA's public key. But, strongSwan VPN configuration requires its own private key. I can't understand it. Am I wrong about RSA-Sig authentication or is strongSwan using RSA encryption?
I use for tests small toy 16-bit elliptic curve: Modulus prime p: 65167 a: 0 b: 7 order: 64879 G: (62171,14828) (generated by brichard19/ecdl on Github) I use procedures: bool Ecdsa16::sign_simple(const uint16_t privateKey, const uint16_t msgHash, const uint16_t nonce, uint16_t &outR, uint16_t &outS...
I want to develop a system where before some activity is performed, the user is sent a hash of a sequence of values which will be an inputs to the activity. The number of possible values is fixed and values are not repeated in the sequence. This I can do: After the activity, the actual full sequence is sent to the user...
To achieve double insurance for authentication, can we sign the GCM final tag with using RSA? with RSA, no one is able to create his own tag since the private key is not known. However, according to FIPS.186-4, it looks like the input to RSA must be compliant to NIST approved hashing function. Possible for this GCM + R...
I'm wondering what is the current knowledge regarding the difficulty of solving the Diffie-Hellman problem (DHP). Obvisously solving the DLP (discrete log) is at least as hard as solving the DH problem. What about the converse : In a general setting (cyclic group, no other assumption) ? With specific groups (multiplic...
A man encrypted a hard drive in 1996 using three key 3-DES with a 64 bit IV and CBC mode in the following manner using known 1990s algorithms on a 1996 PC. Here is how he did it. Start with a randomly generated 256 character (full 0-255 range on each character) key generator. Randomly generate a 64 bit IV in a separa...
I can recover something trivial like a 16-bit AES key in practice. I'm confident that a 64-bit AES key can be recovered. However, I have been unable to find any documentation of the biggest AES key that anyone claims to have recovered in practice. Are such competitions held, and is there a recognized progress meter tha...
In a threshold encryption scheme, a dealer generates $(PK,SK1,…,SKn)$ and distributes the secret keys to users indexed by $1,…,n$, and if a combiner obtains $t+1$ partially-decrypted ciphertexts, it can retrieve a plaintext. When only for one message $M$, we can first use public key $PK$ to encrypt $m$ and get $C$, the...
So given you can find a collision for any MAC value, would this be viable without knowing the key. Even if you couldn't figure out how that MAC function works, could you find valid MAC values for a message without needing to know how it works. If so how would you go about doing this.
Consider AES-256, 128-bit blocks, and PKCS#5 Padding. During a Padding Oracle Attack, a manipulated byte of cipher text is sent to the oracle and we eventually hope to find out what that respective byte of plaintext was. If I know the set of possible characters in the plaintext will only be lowercase english letters, t...
So I have a set of coordinates and I will hash these with a random salt with SHA256. Coordinate range is 0,100. salt = abc [1, 5] = "sZv6eqPT9bqGiXbjvO8yrb4wuFjl0Z1CwSHdnIgGqEI=" [3, 4] = "8XgDJ/rrDELExVflBfDOLjqV5SB//8urxN5I6hxK9Mo=" [6, 3] = "FTzCfctBaBKp/wmopgMw7YFRpo1z2p6/IdHVujFliGs=" [1, 6] = "t2WE+ba8pt0ZEo0uW3u...
If I understand correctly MAC makes sure that the encrypted message isn't altered, so I presume signing the message with for example ed25519 would do the job too. Am I right?
Blowfish has a large key setup penalty, except is fast once it gets rolling. I believe that before AES optimizations became commonplace, it was faster than AES after the initial key setup. It's top speed once it gets rolling is good for bulk encryption, except it has a 64 bit block size. Would the following address ...
Let $F$ be a pseudorandom function (length preserving). We have the following scheme: To encrypt $ m \in \{0,1\}^{2n}$, parse m as $m_1||m_2$ with $|m_1|=|m_2|$, then choose $r\leftarrow\{0,1\}^n$ and output the ciphertext $(r, m_1\oplus F_k(r), m_2 \oplus F_k(r))$. Is this scheme EAV Secure? I think that it is not EAV...
Assume that we use the key to perform a uniform permutation to generate a sbox. The literature is rich supporting the statement that a random Sbox can make any cryptographic scheme weaker. I have tested and found the randomly permuted sboxes possess weak nonlinearity and high differential probability. We know that to p...
I'm looking at the AES-CMAC RFC and I found somehow counter-intuitive the way test vectors are used in the test code. Let's look at the key K K 2b7e1516 28aed2a6 abf71588 09cf4f3c The least significant octet is 0x3c, right? If this is true, why it becomes key[15] and not key[0] in the test code? unsigned char key...
Let's say you need to encrypt plaintext which is 1 TB big. You have a password pwd. This very classical AES-GCM process is applied (pseudo code): salt = 16 random bytes key = PBKDF2(pwd, salt, count=1000*1000) # key derivation function nonce = 16 random bytes ciphertext, tag = AES_GCM_cipher(key, nonce).encrypt(plaint...
In post-quantum signature schemes that are (to put it simply) built out of merkle trees, they usually employ some sort of OTS scheme on the very bottom leaves. I.e WOTS Winternitz scheme. A relatively simple scheme such as Merkle is making a bunch of Lamport/WOTS keys and putting them on a merkle tree. Is it possible ...
Section B2 of FIPS-202 specification describes the Hexadecimal Form of Padding Bits which is basically the translation of the bit padding 0110*1. However at the beginning they suppose that the message is "byte-aligned, i.e., len(M) = 8m", so what should I do if it is not (ex when the length is odd)? In section B1 they ...
There a plethora of signature scheme's but I am wondering if there are scheme's with the following properties: Given that you know the message, alter the signature with the public key in such a way that a new signature is created (a different hash) but is still valid for the given data. The reason I am looking for this...
Suppose there is a new scheme, for the sake of argument let's call it a CEPQSS - CryptoEnthusiast's Post-Quantum Signature Scheme. Now most practitioners aren't convinced that using this is a good idea let alone that it works. But the results are completely valid. How long would it take until most practitioners evaluat...
For background, a HKDF (hmac based key derivation function) takes the form of Ko = KDF(Ki, Label, Context, Len) where Ki is the input key and Ko is the (usually longer) output key, computed by iteratively applying HMAC (initially keyed by Ki) until the desired length is reached. See pseudocode here. Can I assume HKDF i...
Based on the BSI evaluation criteria for quality of deterministic random number generators: K4 – It should be impossible, for all practical purposes, for an attacker to calculate, or guess from an inner state of the generator, any previous numbers in the sequence or any previous inner generator states. What is exactl...
I just found this draft/informal IETF specification: Alternative Elliptic Curve Representation: This document specifies how to represent Montgomery curves and (twisted) Edwards curves as curves in short-Weierstrass form and illustrates how this can be used to implement elliptic curve computations using existing implem...
I come from an engineering background, but not from computer science or anything to do with pure math. I studied applied math in college--never abstract algebra, number theory, or discrete math, formally. I have been a programmer most of my career. Having developed a keen interest in cryptography, I learned number theo...
After reading a comprehensive paper [1] covering various kinds of generalized Feistel networks, I've tried to implement the Unbalanced Numeric Feistel variant, which relies on modular arithmetic for splitting and joining an integer in two smaller parts. Given the scarcity of example implementations for this kind of cip...
I was thinking about the Diffie-Hellman key exchange. One fact that we seem to know is that given a group generator $g$, a prime $p$ and the expression $g^x \bmod p$ its believed to be hard to find $x$; or more accurately $x \bmod(p-1)$. Now the question is, what if we gave away some extra information. Such as $g^{x^2}...
$p$ is a big prime. $p>2^{2048}$. So how to caculate the summation of successive modular inverses over $p$? $$ \sum_{i=1}^{\frac{p+1}{2}-1}{i^{-1}}\pmod p $$ As to $p$ is a big prime, it's impossible to caculate the modular inverses one by one and sum them at last. I found someone give a formula which approximates the ...
The BGW protocol gives us security aginst a dishonest minority of parties, with round complexity linear in the function's circuit depth. Several works (like ABT18 or LLW20) use the BGW protocol to get 2-round MPC by reducing the functions degree to 2. However, I don't see how BGW gives us a 2-round protocol. You need o...
I have read the paper [ABB10] several times but I still cannot understand thoroughly the "artificial abort" in the security proof of the adaptively-secure IBE in the paper. So my questions are: What is exactly the $\gamma(\cdot)$ function in the Artificial Abort step? From what I found in this paper (on page 14), it s...
I have a message that I want to send to multiple recipients. Can I encrypt the message separately with each of the recipient's public keys, then send the message thus encrypted to the respective recipient? If an attacker obtains all the encrypted messages and knows that all of them have the same content but are encrypt...
I'm studying GPS, asymmetric identification scheme from the NESSIE project. I found a bunch of helpful information about it in the original submission, they even mention minimal implementation examples (in C/GPS-C.pdf of submission archive). But they only mention them and provide instructions on how to compile them, so...
one.ttf (3f67f2feb32a72cf4b90c767eb43aa52) two.ttf (8880bae64dc9e6ba22446f789d09d3d7) I want to set one.ttf md5 hash to two.ttf It is possible? Like this one.ttf (3f67f2feb32a72cf4b90c767eb43aa52) two.ttf (3f67f2feb32a72cf4b90c767eb43aa52)
If I want to encrypt structured data composed of key-value pairs of strings, would it be an advantage to use an encoding that stores keys, values and their lengths, and is padded with random numbers, rather than JSON that always starts with {", ends with "} and predictably contains strings enclosed in "..." separated b...
I came across a piece of software that uses the following algorithm to generate a symmetric encryption key to encrypt data. Generate a non-secret 64 byte random string $M$ (fixed challenge) Generate a secret 20 byte random string $K$ (HMAC key) Compute $E = \operatorname{HMAC-SHA1}(K, M)$ $E$ is a 20-byte encryption ...
I've been reading about The discrete logarithm problem as of recent and i decided to try it out on a small portion of numbers myself and i actually came to a mental gridlock after watching this Video. In the video, he uses the mod p which is prime to find a specific generator point (which is also prime) that could ite...
As far as I know JWE (JSON Web Encryption) supports both integrity and confidentiality. I agree about the confedintiality because only the recepient with a private key can decrypt a message. What about the integrity? Given that the Content encryption key is encrypted using a public key, anyone (who knows the public key...
Consider a block cipher whose block length is . = 2 is number of possibilities. Imagine we have plain text-cipher text pairs { , = () } , where the key selects one of the ! Possible mappings. Now, imagine you want to brute force this encryption algorithm for the key. In each try, you generate the test key ′ and ch...
Given a keyspace of $ 2^{80} $ and plaintext space of $2^{64}$. And two plaintext and ciphertext pairs $(x_1, y_1)$ , $(x_2, y_2)$. Now we have $2^{80}/2^{64} = 2^{16}$ keys that encrypt $x_1$ to $y_1$ and another $2^{16}$ keys that encrypt $x_2$ to $y_2$, with only one key that is supposed to be the target key (correc...
I've read that the Blake3 hash uses a Merkle Tree. Does it follow that there are identities such as: b3sum("This is ") xor b3sum("a test.") == b3sum("This is a test.") The example above does not work, perhaps because the block size is not eight bytes. Are there any real Blake3 identities of a similar form?
This is from the transcript of Dan Boneh's Coursera Crypto course https://www.coursera.org/learn/crypto/lecture/mQAkP/real-world-stream-ciphers So it turns out this is easy to break in time roughly two to the seventeen. Now let me show you how. So suppose you intercept the movies, so here we have an encrypted movie th...
I'm doing a spare-time project to collect cryptographic algorithms, implement them, and lastly benchmark them. For the CSPRNG part, I'm evaluating NIST-SP-800-90Ar1 HMAC-DRBG and CTR-DRBG (Hash-DRBG had problems so I dropped it), and I wonder how better HMAC-DRBG will perform if HMAC was instantiated with BLAKE2 instea...
I'm having trouble with a definition in the HQC Specification. From page 25f., in section 2.5.5.: What does it mean to duplicate a code? Is it repeating each bit, similar to a repetition code? Further, I don't understand the type of the function $F$: $\mathbb{F}_2^7 \to 3, 1, -1, -3^7$. Is this a typo, and it should ...
Apologies if this is already answered somewhere, but I could not find it. I have a setup where a client has a JWT (RSA- or ECDSA-signed), and needs to prove that fact to the peer which issued the token in the first place, in a way that's safe against person-in-the-mittle attacks. The peers have no prior knowledge of ea...
Although this question maybe looks silly, I have searched similar questions in this forum and googled it but got no desired answers. IND-CCA security has already been deeply studied in public cryptography. And it is also known that some symmetric constructions (e.g. CBC model) are not IND-CCA secure (for example, see t...
Optical discs are prone to damage, and for this reason, they usually store data encoded with an error correcting code. While day-to-day use for optical storage media has diminished in recent years, they continue to be used for distribution of movies and TV shows, given they have special value to collectors. In such app...
When we pick $e$: $$e \in \{1,2,3,4,...,\phi(p\cdot q)-1\}$$ where $\gcd(e,\phi(p\cdot q))=1$. Similarly when computing $d$ which is the modular inverse of $e$ (the private key) we use the extended Euclidean algorithm as $$\operatorname{EA}(e, \phi(p\cdot q))$$ so that $$e\cdot d \ \equiv \ 1\pmod{\phi(p\cdot q)}$$ So ...
Suppose I have a physical object A. Another person also has some rights over the object A. After some litigations, a schedule has been made under which object A will be passed for some time to the other person (e.g. if I possess A then I must give it to the person at a specific time and then after some agreed upon time...
What is the Lenstra–Lenstra–Lovász lattice basis reduction algorithm about? How is it applied to solve for $x\pmod m$ a system of modular inequalities $(u_i\,x+v_i\bmod m)<w$ for $0\le i<n$? I'm aware of this related question, but would like something introductory and detached from a Linear Congruential Generator. I un...
Does a sigma protocol have an adversary advantage of zero for soundness? Or is this affected by the probability distribution of the indistinguishability of the simulator? Will in that case using the Fiat-Shamir heuristic affect the adversary advantage?
Does there exist a cryptographically secure hash function (or keyed PRF) that can take, as a parameter, the number of 'hot bits' in the output? And if so, what is the name? The goal here is to produce a cryptographically-secure pseudorandom bitmask with a fixed number of bits in the mask. E.g. $\text{some_magic_hash}(x...
Is there an encryption scheme such that you can encrypt some data (such as an image) once, generate multiple decryption keys that can decrypt the ciphertext (so far this is just shamir's secret sharing, but wait for it!), and when the data is decrypted it comes out slightly modified/"watermarked" in a way that reveals...
A 2nd preimage attack is possible on the standard Merkle tree as pictured below. I'm aware that we can add identifiers (to differentiate nodes) to the input of each hash as discussed in the link. If then using a good hash function, it should be resistant to any kind of attacks. However it would be preferable to have ...
I understand that asymmetric encryption is fundamentally deemed useless under Shor's Algorithm, and understand that symmetric encryption is somewhat quantum-resistant as long as the key-length is equal or above 192-bits. MACs are symmetric cryptographic primitives, however, I have heard that they may be insecure due to...
This is a question from reading the paper 'Coin Flipping by Telephone - a protocol for solving impossible problems'. The fact that the coin is unbiased is based on the fact that if n is a product of two primes, then there should be exactly four solutions to the congruence $ x^2 = f^2 \pmod n $. What if Alice is malicio...
I've been looking around for any studies done on this topic with respect to memory-hard password hashing. I'm inclined to simply impose no extra overhead by default, to be honest, but I'd really like to know what the industry standard recommendations might be.
We already know that every authenticated encryption scheme is CCA secure, I was wondering about the converse. I believe it is not true, and I am finding trouble to construct a scheme which is only CCA secure but is not an authenticated encryption. How to show the existence of an encryption scheme which is only CCA secu...
I feel DSA is vulnerable if k is randomly selected over a small set, example, {1,2,...,2^16 -1}. I am trying to come up with a program where I assume I have the public parameters (p,q,g) , public key : y, message m and its signature pair (r,s) signed with x and k. We also have hash value h (where h=SHA-1(m)). I want to...
I need to encrypt big files using AES-GCM, potentially 10 GB or more. For memory (RAM) reasons, I need to processs them by blocks (let's say 16 MB), rather than doing encrypt(plaintext) in one pass. By reading the answers of this security.SE question: Should I chunk or not for AES-GCM file encryption, I have the feelin...
I am just learning about RSA encrytion and I am somewhat confused. First two prime numbers $p$ and $q$ must be chosen and multiplied to get $n$. Then we compute Euler function $\varphi (n) = (p-1)(q-1)$. The public key $e$ is generated by choosing a random number that fulfills the condition $gcd(e, \varphi(n)) = 1$. An...
I'm working on a document-editor project, and I would like to add a feature to lock tracked changes, similar to Microsoft Office. The goal is to allow one user to lock tracked changes with a password, which would allow other users to only edit the document with tracked changes. Any edit to the document that is not tr...
I have been trying to come up with a proof of the following statement, Suppose a cryptosystem achieves perfect secrecy for a particular plaintext probability distribution then Prove that perfect secrecy is maintained for "any" plaintext probability distribution. Well I know that the perfect secrecy scheme is independen...
Let's say $\mathrm{Hash}(A\|B)$ is a hash of two concatenated strings, $A$ and $B$. Suppose I am trying to figure out $A$ from $\mathrm{Hash}(A\|B)$, I know $B$ but not $A$, I want to brute force to find $A$. Let's ignore practical reality for a moment. If I also know $\mathrm{Hash}(A\|C)$, $\mathrm{Hash}(A\|D)$ etc, a...
What are the tests which a regular PRNG would fail but a CSPRNG would succeed? Is it just the next-bit test or are there multiple other tests which a PRNG which is not a CSPRNG would fail? Would a PRNG which is not a CSPRNG pass the Chi Square tests?
Assuming I am using different secrets/keys for each MAC pass, does running both MtE and EtM creates any vulnerability? This is what I mean about doing MtEtM: K0 ≠ K1 ≠ K2 addMAC(msg, K) = msg || MAC(msg, K) ciphertext = addMAC(encrypt(addMAC(msg, K1), K0), K2) If I understood correctly, EtM has the advantage of ensuri...
If a standard encryption scheme involves a nonce, as most do, can the nonce be used to hide another small message? That is, the nonce (rather than being randomly generated) is a hidden message XORed with another secret key. As long as this other secret key is hashed/random and unique for each message, this is equivale...
I am using the python hmac module to generate an authentication code. Given a key, message, and hash function (I am using md5), the library returns an authentication code as a python bytes object. I am using the first N bytes of the code, i.e. digest[0:N] if digest is the variable storing the code. How do I unambiguous...
If I let the authentification tag aside (which is important), encrypting with AES-GCM and a fixed key and nonce: import Crypto.Random, Crypto.Cipher.AES, numpy as np key = bytes.fromhex('7d29ccf69c671775e17d4b9dd6485fd8') nonce = bytes.fromhex('04972c7927042af0ee10c7e6ac56ddd3') cipher = Crypto.Cipher.AES.new(key, Cryp...
If we note all multivariate schemes restrict themselves to polynomials of degree 2. I was wondering why they do it. After looking on the internet, I came to know that they do it for the efficiency. My question is how working with degree 2 is more efficient?
HMAC was introduced in [1], as a MAC that has its security proof based on the properties on the underlaying hash function. The hash functions considered in that paper were ones based on the Merkle-Damgaard paradigm where in most cases, block sizes that messages're chunked into are greater than the output length of the ...
I'm wondering if decrypting with a wrong key is the same a encrypting in a different way. For example if I encrypt the message "hello" with Caesar cipher with key = 3 it will give the message "khoor" but if I decrypt it with key = 2 the result will be "ifmmp". So we can say, decrypting a message encrypted with Cesar cy...
Reading this paper Forward-Secure Digital Signature Scheme I discovered the notion of key evolving signatures. The intuition behind these signatures is clear: one uses different private keys to generate keys in different periods of time, while maintaining the same public key. The paper stresses that whenever a secret k...