instruction
stringlengths
32
27.2k
I think I know how rainbow table works , I just wanted to make basic reduction function(for md5) in python with an approach that I am not taking a certain portion of hash but am taking the full hash and introducing below reduction function with an error handling method below is code. Q1. is it necessary to take first o...
Given: Known ciphertext (in hex) (ciphertext is the exact length of the message (i.e. non-padded). It is known that the cipher was developed using CBC. There is one and only one ciphertext message that was grabbed. The exact ASCII range of the plaintext is known. Known IV in Hex Known partial key! (in binary) 91 bits ...
Background Cryptography can be said to provide the tools used to fulfill the goals of information security. The three pillars of information security are confidentiality, integrity, and availability. For confidentiality, we have ciphers. The relevant security models here consider ciphertext-only, known-plaintext, cho...
I'm trying to find the logic for introducing the S-box, but having trouble understanding why. In a simple cipher, e.g. c = pt xor key I understand that I can easially find the key when choosing the plaintext myself key = pt xor C But I don't see why an S-box can help in this at all, given that the S-box is public. ...
The scenario: On the one side a user enters a pass phrase to encrypt a stream of data (AES-GCM) and a symmetric encryption key is derived from the pass phrase using plain SHA-256 (so not a slow function). Data is sent using TLS. On the other side another user has to enter the same pass phrase to derive the same key for...
I need to generate 64-bit data sequences 16 times pseudorandomly. How many bits should the linear-feedback shift register (LFSR) have in order to do so? That is, what is the number of bits for the initial seed? How can I calculate this number? Can we minimize this number? Should it be a fixed number of bits?
So I am little confused about a type of encryption I read about. You can encrypt your E-mails and pretty much all kind of information using PGP key pairs. However, I am confused if an encrypted message has an expiry date if a key used to encrypt the message has an expiry date too? Let's say I am using a Key1 to Encrypt...
Having: plaintext $P$ a hash function $H$, encryption $E$ with key $k$ $h_p = H(P)$ and $h_{E_P} = H(E_k(P))$ Is there an encryption scheme $E$ or hash algorithm $H$ that allows proving that $h_{E_P}$ represents the same plaintext $P$ (but encrypted) without knowing $P$ itself? In my transmission scheme, there is a...
Lets say we have an arbitrary but dictionary attackable password that is less than 256bit. (Lets just say the password is '1234Password'). We encrypt this password with a securely random 256bit key using AES. So we have encrypted_password = aes(password, key). The key is ONLY used to store this password, and is not use...
This question concerns the Signal protocol's X3DH key agreement protocol as documented here. Obviously, if Alice and Bob have never contacted each other before, they need to run X3DH at least once to agree on a key. However, it is unclear to me why X3DH needs to be run more than once between the same two users: now tha...
I'm trying to implement the scrypt key derivation function using JavaScript. When implementing the algorithm, I found that there was a function called SHA1_Compress listed in the specification. Is the function identical to a normal SHA-1 hash function? Or it is a totally different thing? I tried to search the term with...
Given a public key for RSA, I have extracted the modulus which looks like this : Public-Key: (2049 bit) Modulus: 01:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:...
The following is a representative example of a common hash function:- The asymmetry is clear, and I would expect additional edge effects in the A and E output words. So I'd be surprised if the probability distributions between words A to E are identical to the nth degree. The same asymmetric construction argument cl...
Many resources talk about the benefit of Proxy Re-encryption (PRE) and I also implement my PRE using Elliptic Curve key pair. But after I set up Global parameters, I can encrypt very small data maybe less than 1KB. My question is with EC key pair normally, can we encrypt large data maybe about 10MB?
Assume we have two computing parties for SPDZ protocol. The two parties are also the input parties. How can they share the MACs on their input shares assuming one party is the master who owns the MAC key and one is the client who do not have the key ?
In this Wikipedia article about Neural cryptography (section applications) it states: In 1995, Sebastien Dourlens applied neural networks to cryptanalyze DES by allowing the networks to learn how to invert the S-tables of the DES. The bias in DES studied through Differential Cryptanalysis by Adi Shamir is highlighted....
Assume we use batching and modulus switching techniques to reduce the size of ciphertext in fully homomorphic encryption (FHE). Question: What is the shortest ciphertext bit-size output by the most efficient fully homomorphic encryption? Remark: I'm aware that there're different FHE schemes. I'd like to see what is ...
I have read some documents to decrypt ciphertext without a key using Frequency analysis. here are my questions: If the most occurring Char is not 'E' then how do we start? Let's say I have this ciphertext MLD BLF PMLD GSV TZNV SLD GL KOZB RG. TVG IVZWB ULI HRNROZI KILYOVNH RM BLFI VCZNH. XSVVIH. Here is its...
Assuming you only modify the key schedule so that each of a 128-bit key is used at least once, would DES be about as secure as other ciphers such as AES? I am not talking about 2DES/3DES or other drawbacks like performance etc.
I've got a task to provide the integrity and an authenticated encryption for files in our application. I need an assurance if my way of thinking is correct. I can't use AES GCM, I have to stay with CBC mode. File is logicly divided in 5MiB chunks that are going to be encrypted using same key. IV of first block is rando...
I don't have much formal background, and I could not find a suitable explanation for this after searching on Google/Wikipedia. What is the meaning of the term "language" as used in cryptographic protocols? Sample sentence from a recent paper: Every language in BQP admits a classical-verifier, quantum-prover zero-knowl...
I was wondering if there's any option to create sort of a time capsule in a Word document, i.e. not encrypted by password rather than a date. Let's say I send the document today but the receiving side can open the document only the next month on a specific date.
My professor has posted a couple of practice questions that so far I haven't been able to find the answer for and I was hoping you could help. DES would remain invertible—it would still be ablockcipher—even if its S-boxes were arbitrarily changed (the number of input and outputbits remaining the same). AES wou...
Efficient Identity Based Parameter Selection for Elliptic Curve Cryptosystems by Arjen K. Lenstra contains a proposal for a non-shared elliptic curve cryptosystem. Every party chooses its own field and then after some computations and checks (Table 1 in paper) chooses Weierstrass model. The main reason of this work is ...
MD2 was a hash function based on swapping bytes in a state array permutation, much like the RC4 stream cipher, whereas MD4 was a novel construction. MD4 replaced MD2 despite the fact that MD4 is more badly broken. Even MD5, an improvement upon MD4, is more badly broken than MD2 is! The best collision attack against MD2...
I developed a GNSS logger (http://flysight.ca) which has become popular for scoring skydiving competitions. At the moment, there is little protection against competitors falsifying tracks, but I would like to change that. The device uses an 8-bit AVR microcontroller. Memory and clock cycles are extremely limited. Becau...
I've got two questions regarding the paper FHEW: Bootstrapping Homomorphic Encryption in less than a second. First, the final error of a ciphertext after the refresh procedure is stated as following a gaussian of standard deviation: $\beta = \sqrt{\dfrac{q^2}{Q^2}\left( \zeta^2 \cdot \dfrac{B_{r}^2}{12} \cdot nd_r\cdot...
In the RSA cryptosystem, Wiener, Boneh and Durfee showed that low private exponents can be efficiently recovered. Is it possible to see from a public key alone whether the private exponent (d) is small? Is the public exponent (e) then necessarily large? Is it possible to have a small private exponent when e=65537?
So I'm currently taking a cryptography class right now and my professor has told the class that she can't even define symmetric cipher for us without getting into asymmetric ciphers and the textbook we use hasn't been helpful. It gives me five points: plaintext, encryption algorithm, secret key, ciphertext, and decrypt...
Many cryptocurrencies use Secp256k1. Every cryptocurrency library comes with its own redundant implementation of Secp256k1, ECDSA, RIPEMD160, and SHA256. So, there can be some inconsistencies across implementations. What if some library generates a private key using a different curve than Secp256k1? For example, one w...
I am struggling to understand the proof of security in the UC-framework of the OT by PVW. The cases I don't understand are the cases where: i) Both parties are corrupted. In this case, they say that the simulator just lets the adversary generate and exchange all the messages. But isn't the simulator supposed to extrac...
all the following discussion is for HKDF in TLS1.3: Regarding the 'salt' parameter in - HKDF-Extract(salt, IKM) as written in RFC 5869: HKDF without having to protect the secrecy of the salt. In a different application domain, a key agreement protocol deriving cryptographic keys from a Diffie-Hellman exchange can...
I was wondering what the known metrics are for studying the randomness of TRNG (besides NIST tests). For example, for PUFs, there are known metrics such as uniformity, uniqueness, BER, etc.
I'm doing a decryption competition at a nearby college. We are allowed one cheat sheet so I'm trying to make one. I realized that the Vigenère cipher was very similar to the one time pad and wanted to make sure that I know the difference. As I understand it, the only difference is that a one time pad has a key that ...
I want to know if they do, and if they don't which ones don't require public keys.
I'm wondering what's the computational complexity of computing a hash function/random oracle when doing complexity analysis. For example, what's the computational complexity of computing $H(b\|r)$? where $b$ is a bit and $r$ is a random string of length of security parameter $\lambda$. If $b$ is a string (i.e., a strin...
Other than key size, What are some differences between the Elliptic curve ed25519 and ed448?
i am thinking about building a public crypto service, yet at the same time, I am still quite new to crypto and therefore prone to snake-oil inventions I guess. My plan is to build a website which allows encrypting a document for a certain time. The current scheme I came up is as follows: choose the time at which yo...
I'd like to use the output of a pseudorandom function (PRF) as a one time pad. I want to use AES-128 (as it's commonly used as a PRF). As we know AES-128 output 128 bits. Question: Would be secure to truncate the output of AES-128 and get only 32 or 64 bits of it as one time pad to mask some 32 or 64 bits value respe...
Given a public key for RSA, I have extracted the modulus which looks like this: Public-Key: (2049 bit) Modulus: 01:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00: 00:0...
Flaw in Enigma One of the Enigma machine's flaw was the derangement (fixed-point free permutation) of the produced ciphertext, or simply put: No plaintext-letter can be enciphered to itself. See this example from Wikipedia of how this text (in German) "Keine besonderen Ereignisse" can or can't be encrypted: More moder...
Knowing that VIC was a "spy cipher" it is unlikely that the agents used a cryptographic device to genreate the 5 digit number but how did they do it?
This was told to be an attack. However, we can create a simulator in the ideal world which sends all 1s to the trusted party and receives the number of ones of the honest party. Is this simulation correct?
How would one construct a security model to play against the adversary, and define the security of the overall scheme? This is in reference to the scheme introduced in "Fully Homomorphic Encryption Over Ideal Lattices".
I'm wondering that is there any equivocal commitment scheme (i.e., trapdoor commitment) can be constructed from lattice-based assumptions? I know there are a lot of commitment schemes from lattices as described in More Efficient Commitments from Structured Lattice Assumptions (described in the introduction) but I do no...
I read The Three Ballot Voting System by Rivest. This paper-based voting system can be attacked with chain voting. But can't find any description of what "Chain voting" is mentioned in section 4.9. Would anyone explain what it is?
Suppose I have two machines which can ssh into each other. Is there very little point in using gpg with a password protected symmetric cipher to transfer a sensitive file, and going to the effort of sharing the password - over, say, an encrypted call? I realize that theoretically the ssh communication could be compromi...
What is the purpose of ZKPoPK in the SPDZ paper? And will the following can detect the active adversaries in 2 party spdz excluding ZKPoPK step? Each party sends a commitment on his MAC key ∆_i before starting the offline phase. Parties select random a_i and b_i and broadcast the encryption on a_i, b_i, ∆_i These...
This is just a curious question, and it probably doesn't belong here anyway, and I'm just being bold asking it here. 80-bit used to be considered an adequate level of security, Skipjack and SHA1 were designed to be 80-bit-secure. But why 80 bits? Isn't 96 bits better because it's a multiple of 32 and gives a higher ma...
I was studying OAEP and see we introduce a random value $r$ when computing the padding. See the figure below from Wikipedia So if we are adding randomness to encryption, how could this ciphertext be mapped to plaintext? I understand a plaintext $m$ being mapped to numerous $c_i$ ? Also to decrypt, don't we need to kno...
I have seen in some places applications of Shamir secret sharing and lagrange interpolation mixed with bilinear pairings, however I fail to understand how this works. For instance, here I find the statements: $pk_{common} = \sum_{i=1}^{t+1} l_{i}*pk_{i}$ $e(h, pk_{common})$ If $pk_{common}$ is a point in some $\mathb...
If you have a manual encryption system where the keying is done by extracting a key from a book, a major weakness is that an adversary can search trough all existing books to find a perfect Match and thus the key. But isn't that very theoretical since not all books can be accessed by every one on the internet? What ca...
In some Differential-Privacy(DP) papers, they use epsilon as the x-axis in the figures of the experiments' result while other papers use the sensitivity. What is the relationship between epsilon and sensitivity in the DP? How can I compare the results of different papers?
I am building a range proof to prove that a secret number x lies between a specific range a prover commits to a values a<x<b prover generates a pedersen commitment to a value a prover generates a range proof to commitment that is commitment from 1 minus commitment from 2 prover sends range proof together with the o...
I have a binary sequence of length $2^{20}$. I am using the NIST statistical test, assess. What should be taken for ./assess and How many bitstreams? in this test? In the final Analysis report, what p-values should be there to pass this test?
In Evaluating 2-DNF Formulas on Ciphertexts stated that decryption in this system takes polynomial time in the size of the message space T. Therefore, the system as described above can only be used to encrypt short messages Is there any other extension with the same properties of (any number of addition and one mult...
I understood that one-time-pad (OTP) encryption ensures perfect secrecy. However, I couldn't find any real-world examples where an OTP was used. Also, what are some real-world examples where it won't be suitable to use the OTP.
One of the often pointed out mistake in dealing with crypto is not having enough entropy in the system. Without enough entropy the random numbers generated are not random enough. But what I am not able to piece together is how exactly the lack of randomness can lead to less secure systems. In what does a key generation...
Is there a way to generate thousands of PGP keys at a very very fast rate? I am generating thousands of 3072-bit PGP keys looking like part of a personal research project. Obviously, this is a very slow, CPU intensive activity. I have turned off strong randomization with the --debug-quick-random, am generating them usi...
In the pkcs#10 workflow to obtain the x.509 certificate used in digital signature, in the Certificate Request Information, itself in the CSR, we have the Subject Public Key. That Subject Public Key will be used to verify that the CSR isn't modified since the Subject wrote it. All is fine up here. Once the verification ...
I find some different definitions of non-malleability for the encryption schemes. They may be equivalent, but I am not sure which one is better or if there is a standard definition. I give two definitions of NM-CCA2 for PKE schemes. Relations Among Notions of Security for Public-Key Encryption Schemes: Def1 Let $\Pi =...
Is GMW (How to play ANY mental game) protocol different from Secret Sharing?? If so, how is it different from Secret sharing?
I am currently doing a research paper on the Blowfish encryption algorithm and one of the components that I need to include is time and space complexity. I have tried reading academic articles and journals, but they have the complexity in the matter of kilobytes. Would anyone have an idea on what is the time and space ...
I am new to studying digital signatures like ECDSA and EdDSA, and was curious about something. Lets say hypothetically I want to create a digital signatures of millions of files, with a total size of 10TB. From what I understand, digital signature algorithms are hash-then-sign, and the hash functions used must be crypt...
I have been working on implementing the NORX V3.0 authenticated encryption algorithm and I have run into a very confusing contradiction regarding the order in which padding and permutation are performed during header, encryption, and trailer operations. According to the V3.0 specifications (https://github.com/norx/reso...
Is there any practical algorithm that will allow to use public key cryptography (RSA or ECC) in the following way There are N parties. Up to M are malicious adversaries (were trusted, but got taken over silently). I will be happy with solution for any N and M = 1. Parties can communicate securely. No eavesdropping. Pr...
First of all, excuse me if this question is too noobish. I'm trying to understand how these things are relate: Curve type, its 'number of bits of security', size of the key and the maximum ciphertext size. Comparing to RSA, I know, that size of the key directly affects the maximum size of ciphertext: it can never excee...
Is there something similar (or an other efficient approach) to the NTT for the multiplication of polynomials in polynomial rings modulo $X^{2^n} + 1$ with coefficients in $\operatorname{GF}(p)$ with $p \equiv 1 \pmod{2^{n+1}}$, but instead for polynomial rings with coefficients in $\operatorname{GF}(2^s)$?
Given $E_k$, which a block-cipher using the (known) key $k$, and a plaintext-ciphertext pair $(p,c)$ where $c$ is the encryption of $p$ using CTR mode, can the initialization vector be recovered using $IV = E_k^{-1}(c \oplus p)$?
The JOSE suite specifics use of RSA-OAEP (for when one party has an RSA key) and ECDH (for when two parties have EC keys) in JWA. Why doesn't it include ECIES? It seems like a way to derive a key when only one party has an EC key would be a common need.
As per the Stallings book, the normal decryption of AES has different sequence of transformations [method 1 below], which leads to two separate software or firmware modules and that is undesirable. However, with the interchange of the ISR and IBS operations during decryption (as they are equivalent), the encryption and...
For example, If I wanted to prove that: $$x^2 + x^3 = 45$$ This cost of this would be calculated by counting the number of multiplications that need to be done, and not the addition of $x$ squared and $x$ cubed.
I am playing around with GPG which I'd like to use to sign an integer and use the resulting signature binary in another piece of code. So far I have created a simple PGP packet parser with which I think I can successfully extract the elliptic curve point representing the public key. Comes then signature parsing from th...
As the final permutation of the Feistel function is the inverse of the initial permutation, it undoes the initial permutation.So how is this helpful?
I am learning about crytography and the differences between the public and private keys encryption examples and I was wondering if it is possible to have a private key encryption scheme that is completely insecure? I have not been able to find what that could look like but I'm curious? Or is this not possible? Is the e...
Can someone provide a good and thorough explanation of the El Gamal proof? Basically, I need a step-by-step breakdown of what is happening at each important part in the algorithm. I haven't been able to find any good notes on El Gamala that explain the proof in an easy to understand format. Here is the proof in this im...
On the Wikipedia page of ECDSA, it is stated in step 6 of the verification algorithm that If (x1,y1)=O then the signature is invalid. In X9.62, it is also stated that If u1G + u2Q is the point at infinity, then reject the signature. However, I cannot find explicit checking for this condition in multiple open-source lib...
I'm having a little trouble understanding the finite fields theory, so I'm sorry if my question would seem a little stupid. I wanted to know if a finite field of 36 elements could exist. Basically, I thought of the field $\mathbb{F}_{37}$, which has 37 elements. But does for example the invertibles of $\mathbb{F}_{37}$...
Using the terminology of https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm Why is the second part of the ECDSA signature defined as: $s = k^{-1}(z+rd_A)\text{ mod n}$ Could the scheme not work just as well without multiplying $d_A$ by $r$? In other words we would have: $s = k^{-1}(z+d_A)\text{ m...
I need a symmetric key protocol that will mutually authenticate and establish a new short-living session key between two parties that have a pre-shared key. Unfortunately, I have not found any existing protocol that would fit my purposes, so I quickly devised my own. Would greatly appreciate your feedback on the protoc...
My cryptography slides describe several relations between cryptographic problems. I don't still have a good justification on the following: If decisional Diffie-Hellman problem is hard then there exists a CCA-secure public key encryption scheme. How is this justified?
Why Static RSA and Diffie-Hellman cipher suites have been removed in TLS 1.3? How keys can be exchanged then? https://datatracker.ietf.org/doc/html/draft-ietf-tls-tls13-28
I am new to zero knowledge proofs. I read the paper Efficient Protocols for Set Membership and Range Proofs by Jan Camenisch, Rafik Chaabouni and Abhi Shelat. The author proposed a zero knowledge set membership protocol in page 9. Then, he stated in theorem 1 that the the protocol is a zero-knowledge argument of set m...
My cryptography slides describe several relations between cryptographic problems. I don't still have a good justification on the following: If trapdoor permutations exist then CCA-secure public key encryption schemes exist. How is this justified? The slides cite this article. I was wondering if there is a short expla...
Say you run in to a messed up AES (128) implementation which has the s-box configured as [0x0, 0x1, ..., 0xFE, 0xFF] and where you can query a few plaintexts to get the corresponding ciphertexts. How many queries would one need to be able to deduce the key, and how would one go about it? This would be a chosen plainte...
I'm trying answer the following question. Yes, it is a homework question, so I'm not asking for the answer directly but would like to get some pointers on how to solve it. So far I have spent several hours thinking about this to no avail. I know I'm missing something incredibly simple. I have tried various permutation...
From TLS 1.3 there are two signature algorithms using edDSA: /* EdDSA algorithms */ ed25519(0x0807), ed448(0x0808), All the other signature-schemes provide hash information, for example: ecdsa_secp256r1_sha256 => sha256 rsa_pkcs1_sha384 => sha384 How can I determine when receiving edDSA signature ...
I'm wondering why there is so much debate about letting Huawei build 5G networks in Europe and other countries. Shouldn't encryption which is used more and more on the web today make all communication unreadable? Are people just worried about metadata? Thanks.
There are two generated ECDSA signatures X - Private key S = ((Z + (X * R)) / K) mod n S` = ((Z` + (X * R`)) / K`) mod n G - Base point, of order n; R = K * G R` = K` * G Why is this formula not working? C = K - K` R = R` + (C * G) Where exactly do I make a mistake?
According to my measurements and to this work, it seems that operations, for example scalar multiplication, are more expensive in larger groups. If I have, for example, an 80-bit elliptic curve and an 384-bit elliptic curve, then the difference is very big: 80-bit curve: 10ms per 1 multiplication on average 384-bit cu...
I have been reading on multiplication over GF for the Inverse Matrix Step in AES, and I feel like converting the hex numbers to binary, multiplying them and then doing the modifications required for GF arithmetic is too time-consuming when done by hand. It would be very helpful if someone could help me with a faster wa...
I'm working on the 2nd part of the Salsa20 spec, and I want to implement a closure for the exclusive-or of two words(u32). The author defines the operation as the sum of two words with carries suppressed, but what does "carries suppressed" mean? Then I come across some summation notation: $u=\sum_i2^iu_i$ What does the...
I'm implementing GCM in C as a way to learn about it. In the paper titled as The Galois/Counter Mode of Operation (GCM) by McGrew and Viega on chapter 4.1, page 11, 12, they talk about the optimisation of GCM via usage of the tables $M_0$ and $R$. What I'm not understanding is how to calculate the table $R$, which shal...
If $f(x)=x_0x_1\oplus x_1x_2\oplus\cdots\oplus x_{n-2}x_{n-1}\oplus x_{n-1}x_n\oplus L(x)$ is a balanced boolean function (which is a boolean function whose output yields as many 0s as 1s over its input). Determine if $f(x)\oplus x_0\oplus x_n$ is balanced. Notice that $L(x)=k_0x_0\oplus k_1x_1\oplus k_2x_2+\cdots\...
Keccak provides a sort of very useful XOFs. Can other sponge construction hash function like Spongent work as XOF? Is there any lightweight XOF for hardware or software implementation?
Recently stumbled upon a discussion in the forum What is Shamir’s Trick used for? Are there any such examples?
It seems to me that signing the hash of the public key with ECDSA should be a sufficient non-interactive proof of knowledge. In my use case, I only need the guarantee that "someone even had knowledge", not that the proof is linked to a specific transmitter. Is there a good precedent for using ECDSA in this manner? Si...
This question is actually continuation of my previous one. Secure multi-party computation for digital signature to implement solution there, I have to generate random data for padding (I will use PSS). There are N parties. Up to M are malicious adversaries (were trusted, but got taken over silently). I will be happy w...
I'm implementing a hobby cryptosystem for fun and to increase my knowledge on the subject, and I was wondering if the OAEP construct was still sufficient as an all-or-nothing-transform if variable length hash functions (specifically SHAKE256) are used for the $G$ and $H$ random oracles. I already found a paper showing ...
In this example ( https://kavaliro.com/wp-content/uploads/2014/03/AES.pdf ), the AES-128 key and text are 16 characters each, but how would this example be explained if the key or text was more/less than 16 characters? How would this change the procedure that creates the encrypted text?