instruction
stringlengths
32
27.2k
To implement a decentralized system, I wrote a TLS like P2P net stack. The main idea is removing CA Cert from the whole system by using a DHT for Naming and Key Exchange. I am not a crypto expert, so if there's any flaw please point it out for me here or Github. First, I use an Elliptic Curve for asymmetric encryption ...
I'm looking at a scenario of having a standalone offline root CA sign a subordinate CA in two separate active directory forests on different campuses. If I then set up EAP-TLS on each site, will I be able to authenticate with EAP-TLS on either campus if the client has a computer certificate from either subordinate CA? ...
Let's assume following scenario: There's a ciphered message. Two decipher keys (let's name them A and B) are known. Message deciphered with key A gives valid result - normal text but with no secret information. Let it be a poem or other meaningless content. The same message deciphered with key B gives the right output...
I am currently working on a file encryption software that works via AES-GCM-256 and I am looking for feedback on the encryption key generation process I intend to implement. So far, I have come up with the following process: User supplies password or key file. Then, per file that is to be encrypted: Password/key fil...
Before explaining my question, please let me introduce the scenario: There are 2 type of actors: 1 server and N clients Each actor has a RSA 2048 bit private/public key The server knows all the clients public keys The clients know the public key of the server The desired goals are the following: Clients must authent...
I don't understand how the shapes of isogeny graphs are determined. While Alice and Bob do walk on it and don't backtrack, are they actually relevant to crypto? Also, I was told that supersingular isogeny graphs are expander graphs. Similarly, how is the shape of an expander graph determined
Let’s say I have a message $m$ of $n$ bits. And a predetermined pad of $k*n$ bits. And for every bit $b$ of this message $m$, I’m creating random sequence $s$ of $k$ bits. I also have a predetermined boolean random function $f$ (imagine something like this: $f(s) = hash(s)\ mod\ 2$). For each bit $b_i$, I choose a rand...
How does IES compare versus AES and RSA in terms of speed and security?
I happened to learn that encryption by quantum cryptography would be impossible to break as it's state changes the instant of an eavesdropping event(by non-quantum systems) occurs. But I'm not sure if it's still held in the case of the eavesdropper using a quantum computer(not sure how that works either) as well. Could...
I'm writing a multi-tenant application that interacts with a couple of different APIs on behalf of each customer. Obviously, we need to store private keys for these various different APIs in the database so that we can connect to them. Goes without saying, I need to encrypt those. I wanted to use a separate encryption ...
We are making a system where users can share files with other people but nobody should be able to figure out that all these different files belongs to same user on blockchain. these are the steps we have followed. bip39 specification for generating master public keys and private keys and their 2**32 -1 child keys. If ...
I understand that a client and server certificate is required, however the validation process isn't clear to me. Is it simply that the certificates are check to ensure they're valid, aren't revoked, and are signed by the same root ca? Can certificates from different root CAs (both trusted by client and server) be used?...
I came across the idea of using multiple Vigenere keys of coprime lengths here. The idea is, what if you use multiple keys, whose lengths are all co-prime? Then your effective key length would be the product of the length of all keys since they never line up with each other until that point. It would be fantastic f...
The computational complexity of the extended Euclidean algorithm is $O(log(b)^2)$ ($b$ being the second integer) as referenced by Wikipedia. How to compute the complexity of the modified extended Euclidean algorithm for basis reduction? I know that complexity is equal to the number of iterations multiplied by the cost ...
Can the discret log problem be solved when the modulus is a hard to factor composite number, i.e. when modulus $n=p*q$, where $p$ and $q$ are two large prime numbers?
Quantum computation is based on the superposition principle of quantum physics. Bits in a normal computer are either 0 or 1. Quantum physics allows bits to be in a superposition of 0 and 1, in the same way, Schrödinger’s cat can be in a superposition of “alive” and “dead.” [http://nautil.us] My question is: Can public ...
I've been going through G. Maxwell's paper on the Borromean Ring Signature, and I don't fully understand this part on Schnorr Signature. If some could explain it more intuitively thank you. "Intuitively, this is zero knowledge because if the verifier had slipped the prover pre-knowledge of what $e$ would be, the prover...
Quantum key distribution (QKD) promises unconditional security in data communication and is currently being deployed in commercial applications. Nonetheless, before QKD can be widely adopted, it faces a number of important challenges such as secret key rate, distance, size, cost, and practical security. nature.com arti...
while encrypting the plaintext in an affine cipher we encrypt the alphabets with a=0,b=1,c=2,......z=25 and then use the modulo of 26. Can we instead use to encrypt the plaintext with a=1,b=2,c=3,....,z=26 and then use modulo of 27?
I known the post from here and here regarding RSA padding. I still don't understand why simple addition of the message with an random number and then encrypting the result with plain RSA isn't secure. Here's a more precise description of the scheme: Suppose the message is $m$. Then suppose we draw a random integer $r$ ...
Say you just want to encrypt a number. For example, say the number could be any double. A double in C# and Java is 8 bytes. If you were to encrypt a double using AES (MS-Doc, defaults to CBC as the mode): var cypherText = AES.Encrypt(123d); // 8 bytes would that be trivial to crack? If not would it at least be signif...
There are no Abelian group actions on supersingular isogenies. Why does this make them secure? - motivated by De Feo's Paper on mathematics of IBS
I can't understand a question I came across in a course. You observe three ciphertexts all resulting from encryption of ASCII plaintexts containing English letters and spaces only, using the one-time pad and the same key. The 10th byte of the first ciphertext is 0xA8, the 10th byte of the second ciphertext is 0x...
The Wikipedia states that different multiples of a magic constant are used to prevent simple attacks based on the symmetry of the rounds. The magic constant, 2654435769 or 0x9E3779B9 is chosen to be ⌊$2^{32}$/ϕ⌋, where ϕ is the golden ratio. And according to the code which wiki provides. void encrypt (uint32_t* v, uint...
Hi folks– new to cryptography. My understanding of the double ratchet algorithm (or even just any ratchet algorithm) is that it uses all of the previous state (in Signal's case, all the previous messages in that thread) to compute the next ephemeral key. Does this mean that message history must be saved in order for
I'm designing a system where the client asked for documents to be encrypted with "asymmetric cryptography". I've explained them that the best practice is to encrypt the data with a symmetric algorithm using a randomly generating key and then, using an asymmetric algorithm, to encode that key. The entire scheme is "asym...
I am trying to unwrap a secret key (AES/DES) using Java APIs and SunPKCS11. Problem is that it reveals the value of an unwrapped key (out of HSM) in the key object. Here is the code: Key privateKey = keyStore.getKey("MyKeyId", keyStorePassword); Cipher cipher = Cipher.getInstance("RSA", "SunPKCS11-Safenet"); cipher.in...
A message accompanied with a digital signature and a MAC. are there any possibility to know that the digital signature and the MAC are generated from the same message?
I have read papers which describe that the power traces(acquired from a side channel resistant implementation like masking) need to be centered and squared, then a correlation needs to be performed with the hypothetical power model to perform second order DPA. Suppose if I have a matrix of $m \times n$, where $m$ repre...
I am writing a webpage on which a user can set (when registering) and change his/her password. This page is only served over HTTPS. When the user is altering his/her password, he/she is already authenticated with his/her current password. I am planning to use bcrypt to encrypt and salt the password. Should this be done...
I have a Skype account with a phone number and I noticed that my contacts and I who created the accounts with a phone number have the Skype ID in some form of a hash. But all the Skype IDs have the same length (16). and the link prove skype hash the phone number is herehow skype generate user id What hash algorithm do...
What happens when quantum-resistant cryptography is implemented using a quantum computer? Give the whole deal with the qubits, is this even a worthy action?
The Wikipedia article on GCM says GCM can take full advantage of parallel processing. I had thought GCM uses a random IV for the first block, then for the second block uses the results of encrypting the previous block as the IV. If this is correct, how can it possibly be done in parallel? The question boils down to whi...
In RSA, we choose $p,q$ and calculate $\phi(n)=(p-1)(q-1)$. We then choose a public key $e$, and calculate its inverse modulo $\phi(n)$: $d\cdot e=1 \mod(\phi(n))$. But then, when we decrypt a ciphertext $y=x^e \mod(n)$, we use the different modulus $n$ rather than $\phi(n)$: $x=y^d \mod(n)$. This is equal to $x^{e\cd...
If I’m not mistaken classical OT is not regarded quanum-safe. However I’ve been reading (not really understanding) some papers [1,2] and some reviews[3] on quantum OT and/or post-quantum OT, it seems to be possible. I do have an engineering background, so that’s the reason why I don’t get quantum cryptography papers. ...
So I have this PHP code,it is meant to encrypt a users password... Three problems/questions: My 'salt' CHANGES ITS NAME I get the same result Is this actually how the result is meant to be? PHP CODE <?php $password=$_POST['password']; ?> <?php if (CRYPT_BLOWFISH == 1) { echo "Blowfish: " . crypt("$password", '$2a$...
I am building an Android app that will run purely locally on the user's device, no servers. It has a database that I want to encrypt with the user's password, which requires a 64 byte key. I've considered these 2 ways: Use bcrypt, but that doesn't give me 64 bytes Use SHA512 which is much faster to brute-force The pr...
I am reading about the Fiat-Shamir heuristic to take a $\Sigma$-protocol into a non-interactive zero-knowledge proof (NIZK). I am now wondering whether there is a relationship between a NIZK proof and a digital signature scheme? Specifically, can we take a NIZK proof obtained from applying Fiat-Shamir to a $\Sigma$-pro...
I need my code to generate random elements from $GF(p)$ ($F_p$ or $Z_p$, if you will). The Crypto API I have available provides one with random bit strings. To tailor that to my needs, I can think of two possible solutions, each with its downside. Solution 1: Sample $\lceil\log_2p\rceil$ bits, and reduce its correspond...
Assuming that in the OTP scheme, the key has more values than the alphabet, then: using modular math predetermines that the highest possible value in the ciphertext will reveal the modulus used in the scheme. Therefore, ciphertext reveals highest possible modulus. Put more simply, given enough ciphertext, ciphertext r...
I have a quadratic system of equations related to a balanced RSA modulus $n=pq$ (i.e. $\log p\approx\log q$), and I want to give an upper bound on the number of solutions. Indeed, let $p_i,q_i$ be binary variables, and let $c_i$ be integers such that $0\leq c_i\leq i+1$. $$\left\{\begin{array}{ll} p_0q_0&=c_0\\ p_0q_1+...
I'm confused with the parameter $n$, whether the parameter $n$ is the support point FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F or what? for example I got R = 0x00656073615d18ef82d884366dfcf8f84fd1a95ee7ae431ad8f23a30f7ecc5489c S = 0x00705324ea8a6f796c9c38df621ee07fd86515308a33e...
I’m aware of a couple of OT protocols, most of which use Public Key Cryptography, Key Establishment (or similar constructs) as the base. I don’t really have specific knowledge on other OT protocols, however lately we’ve been discussing post-quantum OT, which actually inspired this approach on some “new(?)” type of asym...
I have question in learning PRG. Given that $f$ and $f_1$ are PRGs, both $\{0,1\}^n \to \{0,1\}^{2n}$. Is $g(x) = f(x)$ xor $f_1(x)$ a PRG? Someone told me that in this case, $g(x)$ is not a PRG, but I don't know how to prove it.
I'm new here--seriously I don't know anything, but my close friend sending me a code and I must solve it. The code uses Rotor III, V, VIII; starting point ABC; reflector BB; and pair OA LU. Can someone give me an example and its procedure about solving a question/code using those rules? Thank you.
There is 1 message, it is encrypted with 6 different keys, each has E = 5. I tried various attacks, but they do not seem to work. Is it possible to receive a private key / encrypted message? Is it safe to use a small E?
I am new in cryptography and I am facing some complications in encryption-decryption. I am trying to use AES-GCM with a 256-bit AES key and a 96-bit nonce. I use an open source project (Vault) to create the encryption keys. Vault can encrypt/decrypt using the generated key. The question is what should I have to encrypt...
This question is related to: How to implement security - authenticity/confidentiality/integrity for 6/14 bits radio messages? I am looking for a message that an attacker listening to the radio trafic will need at least 2 weeks to break it. I came with this solution: 1 byte header 3 bytes UMAC 4 bytes Nonce (incrementa...
The system in question is one with multiple users. Each user has a password associated with their account, and each user owns several public-private keypairs. A user's private keys are encrypted using the user's password, and stored in a publicly accessible database. A system like this would allow users to retrieve the...
How many messages would it take until the success probability of a forger becomes $1/2$? $1/4$?
I have the following question: Which of the following attackers can be used to demonstrate that the shift cipher for 3-character messages does not satisfy perfect indistinguishability? Output m0 = 'aaa' and m1 = 'bbb'. Given challenge ciphertext C, output 0 if the first character of C is 'a'. Output m0 = 'abc' a...
C++ rookie here, trying to wrap his head around (CS)PRNGs. I (assume that I) already understand the concept of the Mersenne Twister being "broken" (i.e. not cryptographically secure) due to its linear recurrence; so an attacker may figure out its internal state by knowing a sufficient amount of outputs and could then p...
I am having a problem with Paillier encryption as described on Wikipedia. It says to pick $0 < r < n$, where $n=pq$ for large, equally sized primes $p$ and $q$. However, I've been testing this under trivial key sizes, setting p=11, q=13, and encrypting m=1. When I try all legal values of r, I find that decryptions...
For one-way function $f$ I understand that $g(x)=0^{n}\mathbin\|f(x)$ is a one- way function with respect to $2n$, where there is $n$ bits of $0$ in the beginning and the output of $f$ in the second half. However, is this also a pseudorandom generator? My first guess was that, because it is easy to find a number that c...
Since the basic version of Diffie-Hellman key exchange protocol is vulnerable to Man In The Middle Attack, some sort of authentication is needed. It was mentioned that RSA digital signature can be used to handle this case. However, I don't understand that if the public keys of the two parties are known to each other, w...
I was watching a lecture about the padding oracle attack on CBC mode block ciphers, where the padding scheme used was PKCS#7. My question is can padding oracle attacks be prevented (without any use of a MAC) solely by choosing a suitable padding scheme? In the lecture, the attack first finds what the actual padding of...
In this answer to a question about choosing RSA's exponent (whether it is better to choose the private or the public exponent), user @Jus12 stated: When choosing $d$ first: [...] guarantees with high probability that $e$ will be large, making encryption slow. When choosing $e$ first: can choose very small or pre-deter...
Homomorphic cryptography is a kind of cryptography that allows you to do special math operations on the ciphertext, and the maths performed are identical to the obvious ones. For example, one person can combine two cached numbers, and decode the result, the sum will be two numbers. What is the purpose of Homomorphic e...
I am new on cryptography and I have a question about the functional signature scheme. The notion was introduced in this paper. In a functional signature scheme, there is a standard signature and verification key pair, as well as an algorithm to derive functional signature and verification keys, for any function f. The ...
I am kind of new to crypto. can someone highlight the differences between authenticated encryption and End-to-End encryption
Fountain codes, as I understand it, allow for the reconstruction of a set of data (e.g. a 64-bit word), by sending (without corruption or failure) chunks of data generated using a probabilistic function, with the benefit that due to an unlimited supply of chunks being sent over an unreliable channel, as long as the thr...
I have a question regarding the keyexchange happening in web browsers. If you check the certificate here on crypto.stackexchange you can go under details and see that the public key is type RSA (2048 Bits). Does this mean that StackExchange is generating a private key via RSA between them and me to encrypt my messages?...
Quick definition: Hiding secret messages inside what seem to be harmless messages is nothing new. The word steganography itself originated in Greece and means “covered writing”. During important historic events of our past, steganography was often used to trade personal secrets, plan covert operations and send poli...
I'm trying to make sure I understand and intuit things properly here, so I'm going to be somewhat lengthy? With this, as I did a cursory search here and couldn't find exactly the case examples I'm looking at. As we generally know, this is how public key crypto would be working. Asymmetric: Two key pairs on each branch...
According to Heisenberg's Uncertainty Principle, it is impossible to measure the values of conjugate variables simultaneously as measuring one accurately would make the other equally corrupt. So in QKD, there's a thing that states that Eve can't eavesdrop as the very act would change it's quantum state(Heisenberg's pri...
Let $n$ be an RSA modulus and assume one has the two following equations \begin{align} y_1 = (x+a_1)^{-1} \pmod{\varphi(n)}\\ y_2 = (x+a_2)^{-1} \pmod{\varphi(n)} \end{align} with known $y_1$, $y_2$, $a_1$ and $a_2$, and where $\varphi$ is Euler's totient function. Is it possible to solve the system and recover $x$?
I am trying to encrypt users private keys with the user password but if a user provides a weak password then the scrypt key generated from it will also be weak and suspectible to attack. Let say the user generates a 32 bit key and the algorithm generates another 32 bit random salt. Then the key generated by XOR'ing th...
I was trying to look into weather or not it would be possible to build a post-quantum version of the signal protocol. The double ratchet algorithm is trivial to modify, replacing the ECDH key exchanges with SIDH key exchanges appears to be enough (since you only have to publish E, ϕ(P) and ϕ(Q) once) provided that the...
I'm reviewing some information and possibilities regarding key space size following a unique password requirement, as it were. This particular requirement is a fixed-length password of 12 characters, with exactly 1 capital letter, and exactly 1 digit. My understanding is that, let's say we have 26 letters, then we'd ta...
Would it be safe? Or is it susceptible to brute force attacks or something else?
Why are there so many types of TEA, for example TEA, XTEA, and XXTEA? What are the differences?
I'm trying to prove that a perfectly secure cipher yields indistinguishability. I already know and can prove that a perfect cipher => indistinguishability by the following proof: \begin{align} \Pr(Enc(m_1) = c) = & \Pr(C = c | P = m_1) \\ & = \frac{\Pr(C = c \land P = m_1)}{\Pr(P = m_1)} \\ & = \frac{\Pr(C = c) | \P...
I'm attempting to decrypt a body of ciphertext which has been encrypted using a monoalphabetic cipher. The trouble I'm having is that the plaintext was base64 encoded before being encrypted. In this puzzle the encryption scheme uses an array containing a permutation of 0-63 as the key. It takes the plaintext and encryp...
I am currently learning the work arounds about RSA algorithm. I wanted to know the time complexity of the encryption part and decryption part on Best Case, Average Case and Worst Case. Im new in analysis of algorithms that's why Im having a hard time analyzing algorithms. Explaning it to me step by step will be great ...
I'm using Pailier Cryptosystem as an additive homomorphic system in my scenario. I have two parties: Alice and Bob. Alice has one pair of (SK, Pk) keys. She encryptes one value using her public key and sends it to Bob. In Bob's side, we need to define whether this value is negative or positive. How can I achieve that?
I'm trying to use MiMC-hash function [1] over Edwards curve, in order acheive an hash function that output a point on Edwards curve. However, in Section 5.1 ([1]), they state that $gcd(3,p-1)=1$, which is not valid the value $l$ (the order of the base point). Is there any trick that I can use to achieve that? (I was t...
Sorry if this is a noob question, but for instance in ECDSA, we start by considering the field $\mathbb F_p$, whose the elements also form a group under multiplication. Why don't we just use this group instead of the one that is generated by the solutions of an elliptic curve equation lying in this field? I.E. choose a...
One-way property: computationally infeasible to find data mapping to specific hash The definition above is a little vague, if we have h(x) = floor(log(x)), finding "some" x that gives a hash value is easy, however, deterministically finding the actual x value that has led to the output is impossible. Do such hash f...
We have an Enigma machine emulator we are trying to replicate. Machine has 3 rotor positions and 6 rotors that can be selected. The input goes through 3 rotors then is reflected back to start as is typical. How can we find the rotor wiring? We are thinking that imputing the same input 26 times while holding the second ...
History contain many example of old steganography. We also have digital steganography. Is there any kind of “Perfect Steganography”, in a sense that only the designer can extract the concealed message? Update Is there a (formal?) definition of 'perfect steganographic hiding' where only the key-holder / designer can p...
Polynomial time seems to be mentioned quite frequently on this site. It often forms a threshold between two possible outcomes like being secure or an attack's validity. I know what $\mathcal{O}(n^c)$ means mathematically, but why do cryptographers not use other kinds of time for so many thresholds? I don't think that ...
The problem is simple: I want to be able to spit out 256-bit "tokens" that only I could've produced because I know my secret key $s$, and given any number of these tokens, no one can figure what $s$ is. How could I do this? Or something similar? Note that I want a "parallel" implementation: e.g. I could give different ...
I have a user A and a third party company B. I want to check if A is a customer of B. B cannot reveal any information about their customer list to me. If A is a customer of B, I do not want B to know which customer they are. They should only know True/False answer to wether they are a customer. What sort of problem...
I believe that in DES every 8th bit is ignored of the key. That means B and C are same if the LSB is ignored. So, shouldn't encrypting a message by the key all Bs be able to be decrypted by key with all Cs? I tried doing it but did not work. I used this tool to check : http://extranet.cryptomathic.com/descalc/index
Does the DROWN attack enable breaking strong RSA keys (e.g. the 2048-bit key itself) or enable breaking the plaintext (i.e. pre-master key) that is encrypted with a 2048-bit (or any strong) RSA, if the key is shared with SSLv2 server?
I'm implementing the Playfair cipher as part of a programming project. I realize there are different versions of the cipher - I've been asked to implement the version which treats the letters 'I' and 'J' as the same letter, and which inserts the letter 'X' into the plaintext to ensure that every resulting bigram has un...
I understand that bit padding (add a 1, then 0's as needed) is a secure way to pad a message, preventing an unpadded message producing the same tag as a message that has been padded. What I don't understand is how this works in practice. Surely a message exists that has a '1' bit followed by several trailing 0's. How d...
I have come up with a scenario to make a secure data. Suppose I have a public encrypted file that anybody can download. But whenever anyone want to decrypt that data they need to get a key from server To make the key cannot be shared. The key from server will not be able to decrypt the data directly. But the data must ...
In specific regarding the NSA's Key Exchange Algorithm, I read in an analysis of the protocol that perfect forward secrecy cannot be provided. Is there any way to prove or justify this? I couldn't find any documentation that showed why that PFS cannot be achieved.
Or did it mostly get replaced by ecdh for key exchange and rsa for authentication ?
It has long been known that randomness can be used to create subliminal channels (see Simmons' "Prisoner's problem" in 1983) and that preventing such subliminal channels is hard. For the case at hand, Simmons proposed a protocol for preventing subliminal channels within the random numbers generated during the creation...
In the other ciphers supported by TLS 1.2, namely stream cipher and CBC block cipher mode, the sequence number is implicitly in the MAC (RFC5246, 6.2.3.1): MAC = HMAC(MAC_write_key, seq_num + TLSCompressed.type + TLSCompressed.version + TLSCompressed.len...
In the original NTRU paper:NTRU: A Ring-Based Public Key Cryptosystem,1996, the author proposes 3 choices of implementation parameters: moderate, high and highest. Let's take moderate security level as an example: I understand the calculation of the public key size: $len_{pk} = N\cdot \log(q)=107 \cdot 6=642$ bits, bu...
I have an RSA public key (public modulus $N$ and public exponent $e$), and the private exponent $d$ of matching private key. How can I compute $p$ and $q$, the primes factor of $N$ ?
I am new to cryptography. My professor's slides say that "Disadvantage: altered ciphertext only influences two blocks" for the CBC. However, since we xor the ciphertext from the previous block and the present plaintext, before encryption; it seems to me like if I alter a ciphertext block, every ciphertext block coming ...
I am trying to wrap my head around encryption in .NET. I am trying to implement a simple solution in ASP.NET Core to encrypt a cookie containing some non-meaningful numbers to outsiders. I need to be able to read the cookie content again. This example (http://www.saipanyam.net/2010/03/encrypt-query-strings.html) uses R...
There are various protocols that allow you to have privacy-enhanced chat. Those can be either 2-party chat such as: OTR SIGNAL or multiparty chat such as: SIGNAL (n+1)sec mpOTR GOTR (2013 spec and 2008 ones) But nowadays many protocols, alongside with Instant Messaging (IM), support multi-party video and voice exch...
When using the Back propagation Algorithm for Machine Learning, it is often said finding the global minimum of a cost function over $\mathbb{R}^n$ is very hard, and as $n$ increases it gets even more complex. I was just wondering if there are any schemes that utilise this property.
Let $g$ be a one-way function, and let $f(x) = g(x) ⊕ g(\bar{x})$ (where the bar over x denotes bitwise complement). Is $f$ necessarily a one-way function?
I lost a password for an ethereum wallet at the end of 2016. Computer immediately shutdown and password was not recoverable. I know there are many potential avenues for narrowing my search for what my password could have been, but I am wondering if the number of characters can be determined from the encrypted file? I ...