instruction
stringlengths
32
27.2k
I want to store a hash for authenticating a password. I also want to use the same password for decryption. Can I use PBKDF2 for both? (I plan to use different salts for the authentication and the decryption, of course, because otherwise the authentication result would be the decryption key!) Is that appropriate/secu...
I am encrypting and storing sensitive values in the database. I have a set max length in the database, but in order to provide useful user feedback, I'd like to know the max input I should allow for a given database length. I can throw together a test that brute forces an answer, but I'd like to understand more general...
can anybody explain to me what data structure results after data is compressed? I just try to find out the difference between random data and compressed data, the entropy of both is very high while the distribution seems to be different (e.g. when I use chi-square-test). i hope somebody can help me and thanks in advanc...
I am trying to cryptanalyse a cipher–text encrypted by Affine cipher. The encryption formula is: $c = f(x) = (ax+b)\bmod m$, where $a$ and $b$ are unknown constants; $x$ is a plain-text symbol, and $c$ the corresponding cipher-text symbol, both in range $[0\dots m-1]$; $m=26$ is known. This is what I got so far: $x=4\i...
In Zero Knowledge auth schemes the public DH factor of each peer is encrypted with a potentially weak pre-shared secret and the resulting ciphertexts are exchanged over an insecure channel. Why is no attack on the weak secret possible? I mean the messages can be sniffed and with an offline dictionary attack or simply b...
i want to know how many RSA 1024 bit long key decryption can a regular pentium4 computer do per second ? how to calculate RSA performance and determine its remaining time ?
Is it possible to generate an Ed25519 keypair that has a very similar public key as another keypair (fooling a casual visual comparison) or is this as hard as solving one of SHA-512 or the discrete logarithm problem?
If it isn't already apparent from the title of my question, i should make clear that I have only a very basic understanding of homomorphic encryption. I would like to know why homomorphic encryption schemes cannot support algorithms with conditions/branching, and what the likely impact will be on the overall adoption ...
These terms are confusing me. One time pad is when you use one key for one message. That is what One time key is. Secondly, what is the connection of many time key, can i use one time pad many times, will it become many time key.
I am trying to understand the ExpandKey function used in the bcrypt hashing algorithm. As per the documentation of bcrypt hashing algorithm on USENIX here: http://static.usenix.org/event/usenix99/provos/provos_html/node4.html There is only one invocation of the ExpandKey function with the 128 bit salt value. After this...
Programs like KeyPass and 1Password store password database files encrypted by a single password. If someone knows the protecting password ("Vault Key"), they can read the entire database ("secrets"). Being part of a family, I sometimes share passwords with my wife and others for bank accounts or Netflix which we manag...
In AES we use some padded bytes at end of message to fit 128/256 byte blocks. But as RSA is not a block cipher why is padding used? Can the message size be any byte length (is the encrypting agent free to choose) or must it be a certain byte length to use RSA encryption?
I have just advanced to the last grade of high school (in Denmark). In this year, we all get to do one big project, where we can build/invent/create whatever we want to "solve a problem". As I study Math, IT and electronics, I would like to build something where all these 3 subjects are included. I have thought about a...
How does a changing key length affects the ciphertext, not only in case of AES, but in general? I know that the key spaces become much larger and the number of rounds in case of AES changes, but is security really that much enhanced that if I choose 256 bits as key length it is sort of unbreakable? Something else what ...
For example, in RSA, we use this for encryption: $ciphertext = (m^e \mod n)$ and for decryption. If our message is "hello world", then what number do we have to put as $m$ in the RSA formula?
I have the following problem: There are $n$ users and each users fills in three data points per day, this are three integers between say $-10$ and $10$. I have access to the database and hence I am able to modify this data. However, I want to "sign" the data. How can this be done in such a way that I am unable to chang...
The Vigenère cipher can relatively easy be broken when the key size is small compared to the size of the message. One first finds the length of the key, and then uses frequency analysis to actually find the key. How can one "add" something non-complicated to the Vigenère cipher to make it harder to break? Would it for...
Elgamal is a cryptosystem that is homomorphic over multiplication. How can I convert it to an additive homomorphic cryptosystem? How can I use this additive homomorphic Elgamal cryptosystem for E-voting purpose? Please explain with examples.
I can encrypt some data D using a random symmetric key K, obtaining a ciphertext C, and then encrypt K with my public key Pub and obtain H. So far so good: I can only decrypt C if I have H and my private key Priv. My goal is to only bring around Priv, and keep both C and H on a public server. Assume C is too large to b...
Our industry (area of cheap networked devices) has a standard that defines the usage of keys for both authentication and encryption using EAX mode of AES. This standard does not define key management, and someone wants to change this key material in devices using the RFC 3394 key wrap algorithm. For that they want to u...
I came up with a truly new method of applying modulo-2-addition encryption function in stream ciphers which is inspired by a mechanism used to prove a mathematical theorem. How can I determine whether my method is cryptographically correct and considerable? If so, how can I officially submit or formally register it in ...
I need a method to authenticate a process with another in order to establish interprocess communication between them, to prevent malicious processes from trying to hook onto the system. Currently I just send a password in plaintext between the two processes and the host process just performs a string comparison with it...
Much of the literature and latest papers suggest that homomorphic encryption is still not practical yet. How is CipherCloud able to achieve this? Does anyone have an idea? Their website does not provide much information about how their system works.
I'm wondering if there are other resources that cover Carter-Wegman style message authentication, besides the sources themselves. Is there an online text or a book that covers their ideas? I'd prefer something that's very thorough, and less importantly, free. I'm just really trying to get a feel for their ideas and...
Suppose there is a message that is encrypted with AES-128-CBC. The message is as follows, new lines are used to delimit the 16 byte boundary for each block: Wire funds from: Alice to Bob in the amount of $ 1 Because this message is encrypted using CBC mode, any modification of the first block of cipher text would ...
Under what circumstances is a decryption routine able to tell that the padding of a message is invalid? If a cipher text block where to be randomly modified, what is the probability that the padding would be correct? How does the type of padding influence the detectability of cipher text that has been tampered with?...
I'm building a bitcoin web application that will require all users to be assigned a wallet for adding funds to their account. I plan on exposing the public key to the user (the bitcoin address). Users will simply use their exchange or their bitcoin client to send money to this address and their accounts will be subsequ...
Suppose I have to use 64-bit keys for encryption (e.g. to comply with export restrictions). For this question, assume this key is truly random, and the encryption algorithm is Blowfish. Blowfish key schedule expands this 8-byte key into 4168 bytes of state (P-array and S-boxes). Will it slow down bruteforce attacks if ...
Suppose we have a state of block cipher initialized with some key unknown to us, that is, we have the state after running key schedule, but we have no access to actual key or subkeys, all we can do is encrypt and decrypt data with this state. How to safely derive an HMAC key from it that we can use to authenticate data...
How secure would a hash function be which appends an extra block of 16 zeroed out bytes to the end of the message and then AES-encrypts it with a well-known password (say the first 128 bits of pi) using cipher-block-chaining and then XORs all the encrypted blocks together?
Why pairing based crypto is being widely used in some special crypto primitives as ID based crypto and variations of standard signatures? I mean taking as deep as possible what makes it suitable for that schemes while other schemes do not feet?
I need to encrypt a file, distribute it over an insecure channel, and decrypt it later. Using a symmetric-key algorithm. Here's what I intend to do: Get a password P from the user. Generate a 16-byte random salt S. Derive a key K1 = PBKDF2(HMAC-SHA1, P, S, iter=2000, bits=256). Divide the data into blocks of 1024 bytes...
By someone's suggestion, I am posting this question from math.stackexchange.com. I want to find out a suitable function or algorithm, which can provide a random sequence like this… Input: $3$ Output: $\{1,2,3\}$ or $\{1,3,2\}$ or $\{2,1,3\}$ or $\{2,3,1\}$ or $\{3,1,3\}$ or $\{3,2,1\}$ Same as if I will enter a number ...
Assuming I had to distribute salt+ciphertext together over an insecure channel, isn't it better to store the salt encrypted? By encrypted I mean with a block cipher and with key and IV derived from the same passphrase used to encrypt the original text. I've been told that leaving salt unencrypted is the way to go. Why?...
Possible Duplicate: Can one generalize the Diffie-Hellman key exchange to three or more parties? How can Alice, Bob, and Charlie share a common secret key using an extended version of the Diffie-Hellman key exchange protocol? a=3, b=4, c=5 g=2 p=5
Should I use a different salt for each password? In my system, there are no user names, only passwords. When a user logins in, he types in one or more passwords and the server compares the results of the password(s) hashed many times (PBKDF2) for authentication. Each password might unlock some subset of functions. As...
Is there a known pair of distinct bit strings (A,B) such that SHA-1(A) == SHA-1(B)? If the answer is no, then how can SHA-1 be considered broken?
Is there an algorithm that can be used to verify the contents of a cyphertext, but not the order of the elements? I am thinking that a deck of cards could be shuffled, and it must be verifiable that the deck contains all cards, but not to know what order they are in. Any ideas how to approach this problem?
I want to encrypt a small amount (few kilobytes) of data and be fairly confident it will be secure against brute force decryption and advances in cryptanalysis for at least a a few decades (or more). I am flexible on the amount of time it takes (even a minute is reasonable) to encrypt as this will run on the client mac...
I realise this isn't a 'yes or no' question, and I apologise for asking something that could be seen as a discussion thread, but I had to ask. I'm currently doing an EPQ in CS (specifically how QC will change Cryptography). I'm trying to gather up topics to cover, and so far I've scribbled down - Effects - National se...
Are there advantages to using TOTP over encrypting a timestamp with a shared secret, in cases where the readability or ease of typing the token are not important?
Could a variable participant lottery system cryptographically prove that they have zero knowledge of the outcome of a draw? Participants do not choose numbers in this lottery and winning numbers are not drawn. Instead, they simply enrol with a wager. Winners are selected by taking all wagers and building an array of 't...
Friday we had a disagreement with a colleague of mine about the implications of SSH server key compromission The question was stated as this : What could a hacker do while provided with the SSH server private key and a MitM position specifically when the client is authenticated with a public key (server configura...
Porticor has an interesting file encryption offering for encrypting and decrypting files in an MySQL database quickly. They are an Amazon AWS (Amazon Web Service) Partner Network technology partner and their product is available in the AWS Marketplace. It seems similar to Gazzang's zNcrypt. Porticor has been touting fo...
I am unsure of how a padding oracle attack works. What I am not getting is how changing one bit at one time allows one to exploit(get keys) ASP.NET machines. Can anyone explain this?
Why RC4 used 24-bits constant value + 40 bits random values to generate key?
This is an idea I had for cipher that I thought might reduce to a known hard problem. It is efficient (compared to something like BBS) in terms of time but not in terms of space. Here's the algorithm: Produce 128 real random streams equal in length to the plain-text. (These do not need to be secret, they can be publi...
The purpose of PBKDF2 is to create a derived key (DK) from a master password (PW) and a salt, often using a function like HMAC-SHA256. I have read that the salt should be as random as possible. But if that's the case, why does it play such a minor role? I'll let the equations speak for themselves, starting with HMAC-...
I have recently been assigned to advise a student on a senior thesis in math. She has taken linear algebra, introductory real analysis, basic cryptography, and abstract algebra. Her interest is in cryptography. And she has a love of Bitcoin. The point of a senior thesis is to get a student to teach themselves a sub...
What are well respected Cryptographic Timestamping authorities utilizing more sophisticated than just PKI (RFC 3161) schemes, like Linked, Linked and signed, distributed hash trees (maybe P2P?), hybrid ? Is there any good resource (better than googling, what does not give information about how well service is respected...
I am implementing a timing attack on RSA for school and I need to generate two sets of messages $Y$ and $Z$ for which holds: $ (Y^d \mod N) \cdot Y < N $ and $ (Z^d \mod N) \cdot Z > N $ where $d$ and $N$ are known. How can I efficiently find solutions for $Y$ and $Z$? I have tried using a random function but it takes ...
Say you have a picture with 1 megapixels taken at random and with $2^{24}$ possible colours per pixel (RGB-24). That image would be unique and the possible combinations $(2^{24})^{10^6}$ immense. However when taking a picture in the real world, say of a clear sky, there will be a lot of repetition. The question is: wo...
I would like to know how to store a sensitive file; a credential of sorts. I want to password-protect it, obviously. It would be appropriate - in my application - to prompt the user for the password each run. There are proper apps - like SSH - that password-protect private keys and so on, and that's the model and be...
For example, Is possible to combine (Concatenate or Chain or XOR) Skein SHA-3 candidate with Grostl SHA-3 candidate to increase security? Note: I just want more secure output and CPU cycles does not matter
I'm encrypting some files using AES in CBC mode. I'm also using file's digest (SHA-1) to check that data is decrypted correctly (so I need to store it with file). Is it safe to use this digest as AES's IV and store it in the header of file? Or it has security issue?
I'm trying to decrypt a message encrypted with Hill Cipher, but I don't understand how to find the determinant so it solves the equation $det * 1/det = 1 mod 26$. The determinant for my key matrix is $62$.
OK, here's the two different ways I was thinking about making the authentication for the login thing to store the passwords securely. The first is the following. Client hashes password bcrypt(username.static_salt.password)(cost is 7) this is mostly to make it harder for someone to get in trouble if they reuse passwords...
i am having problems understanding how CBC works! I know that it is a chain and the IV is XORed with the PT but then what? I mean we encrypt it with key k and the result is the CT which we use for the next chain-XOR but my question is HOW the encryption works? For example in Stream ciphers i just had to XOR the K with ...
In RSA algorithm, the modulus $n$ should be chosen based on the below condition $2^{8(k-1)} \leqslant n < 2^{8k}$ Where $k$ is the byte length of the modulus $n$. for this condition I want the proof with an example. An example is required for the condition: $2^{8(k-1)} \leqslant n$ what is the purpose of this conditio...
I've been reading a bit about cryptographic protocols and I keep seeing the phrase "rewinding argument". I've been unable to find a good source that would explain what is meant by this. It seems like proofs that use this technique cause trouble against active adversaries? I would appreciate if someone would explain wha...
I see a lot of research in very sophisticated side-channel attacks on crypto systems. Most (but definitely not all) seem to follow a trend, namely, the crypto system does something very dumb like decrypt any block given to it with no IV or nonce (so usually ECB mode). That said, there have been practical attacks agains...
Related to this question: Is there any memory trade-off that helps such attack? Obviously if the field size is very small (say 40 bits) it´s possible, but what if the field size is 160 bits long? or 256 bits?
A recent proof of the ABC Conjecture has been released by one Shinichi Mochizuki. Now, I'm not well versed in mathematics but it would appear that this proof implies that finding prime factors could be greatly reduced in computation time. Is that right? Does this show that encryption that relies on prime factors can...
I was just studying the Playfair cipher and from what I've understood, it is just a slightly better version of a Caesar cipher, in that it isn't actually mono-alphabetic but rather the 'digrams' are mono-alphabetic. I believe that since it offers a larger combination i.e 26*26=676 digrams, it is better than a Caesar Ci...
in the course of introduction to cryptography on coursera professor suggested treating all messages as a long stream XORing them with the key this way we will not need to change the key and will not have the IV problem and the question is if so how can we generate a key that will encrypt the whole traffic using just XO...
I need to implement an AES encryption for firmware distribution system. I have a bootloader that can decrypt various AES variants (ECB,CBC,CTR). When I approached this I found few issues that aren't clear to me. First, there's the IV vector, which is strange to me. This vector has to be known to the encryptor and also...
I try to find out the structure of encrypted office files (I'd like to implement something like a carving tool for finding certain encrypted file types). I try to understand the Office Document Cryptography Structure Specification but this seems to be very hard, probably because this is too MS specific. What I found ou...
Like in title: which one of these encryption methods (ZipCrypto, AES-256) is more secure and why? I am asking about it because I'd like to know which should be preferred when compressing files with Zip.
I'm going to encrypt the characters Zhu, and decrypt them using RSA. I'm using the public key $\{e, n\}$ and private key $\{d, n\}$. The values of $e$, $d$ and $p$ I get from my textbook: $e = 17$, $d = 53$, $n = 77$. It works fine when the number is smaller than 76, but in my example below, it doesn't work: z = 90 h ...
I'm implementing ECDH key exchange in C# using the BouncyCastle library and I'm having a hard time understanding the elliptic curve side (FpCurve). FpCurve curve = new FpCurve( new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), // q new BigInteger("7ffffffffffffffffffff...
I've long been looking for a symmetric encryption scheme (or algorithm) with equivalent keys. Let me define what I want: Symmetric encryption algorithm with encryption function $E_k$ and inverse decryption function $D_k$. Existence of equivalent keys. Keys $k_i \neq k_j$ will be called equivalent if $E_{k_i}(\cdot) \e...
Suppose I have an encryption scheme of the form $ E(P)=C $ where $P$ is the plaintext and belongs in $\{0,1\}^N$, $C$ the ciphertext which belongs to $\{0,1\}^M$ and the encryption is performed under the key $K$ in $\{0,1\}^R$. If I pick a subspace of messages $M_0$ and I perform encryption on this set, can I conclude ...
Order-preserving encryption (OPE) is, apparently, a method of encrypting data so that it's possible to make efficient inequality comparisons on the encrypted items without decrypting them. I've been coming across this term in various places (including here) lately, but I have no idea how such encryption schemes are sup...
I've been reading Introduction to Modern Cryptography by Katz and Lindell as an introduction to cryptography. The book seems to use the term 'simulator' when it talks about a game like, for instance, how it defines CPA-security as an interaction between an algorithm and a simulator. Having looked at some crypto papers,...
For some curves it's necessary to validate the public-key of the other side before running an elliptic-curve Diffie-Hellman key-exchange. Apparently if you don't validate the public key, small subgroup attacks can leak your private key. I have a few questions related to this issue: Why can these attacks accumulate inf...
The third-party Apache plugin mod_auth_tkt uses a tragically-not-HMAC construction: digest0 = hash( encode_ip_timestamp(ip, timestamp) + secret + userid + '\0' + tokens + '\0' + user_data).hexdigest() digest = hash(digest0 + secret).hexdigest() How bad is it? Clearly the performance is worse than HMAC.
We had a quiz in class today where we had to break the ciphertext with the key given, but not the algorithm. Suffice to say that I wasn't able to decrypt it within the allotted time of 12 mins and will probably get a 0% score on the quiz. So, I was just wondering if there are some kind of standard techniques that are f...
If I know H = md5( SECRET_KEY | DATA ) then I can calculate H' = md5( SECRET_KEY | DATA | DATA' ) That's length-extension attack. But is the opposite possible? E.g. if I know H = md5( SECRET_KEY | DATA ) can I find H'' = md5( SECRET_KEY ) where DATA is known and lenght of DATA is known too??? Basically, can I find ...
I have to implement protocol of secure data transfer that can be described as Alice selects data to send from finite set $m\in M$ (e.g. $M$ could be a column of values in database table) Alice encrypts selected data with some symmetric(!) algorithm and sends it to Bob. Bob decrypts data and get $m$ Bob verifies tha...
I know the plaintext (26 bytes long) and cryptotext of block cipher (suspected to be AES) in ECB mode. I can generate hundreds or thousands of such samples, but the samples are not arbitrary. What are my chances of recovering the crypto key using brute force methods or using brute-force + some crypto analysis? Is there...
Suppose I have many instances of the discrete log problem, all using the same unknown exponent. Is this problem easier than the standard discrete log problem? Oh, heck, I should be more precise. Let $p$ be a large prime, chosen to be large enough that the discrete log problem modulo $p$ is (presumably) hard. Everyth...
Suppose I have a linear recurrence relation $$a(n) = c_1 a(n-1) + \dots + c_k a(n-k) + d,$$ where the constants $c_1,\dots,c_k,d$ are given and the initial values $a(0),\dots,a(k-1)$ are given as well. Assume that all arithmetic is done over some finite field, say $GF(p)$ where $p$ is a large prime (i.e., everything i...
Let $p$ be a large prime; we will work in $GF(p)$. Let $A$ be a $n\times n$ matrix. Also, let $x$ be a $n$-vector and $k$ a positive integer. Suppose we are given $p$, $A$, $x$, and $y$. The goal is to find a $k$ that satisfies $A^k x = y$. Is there an efficient algorithm that solves this problem? You can assume y...
In reading about the One-time pad it appears to need truly random key for the pad. Since true random values are not practical to generate this presents a problem (thus making One-time pad less practical). If instead I use the operating system provided CSPRNG to generate the key, is that any better than using AES in GCM...
I hope somebody can help me understand the design criterias for AES. Therefore, I would be really thankful if somebody could explain "non-linearity" in this context. A criteria for the s-box in AES is non-linearity, where the maximum input-output correlation amplitude must be as small as possible. Why is a look-up tabl...
Is RSASSA-PKCS1-v1_5 a good signature scheme to recommend that people use in new systems? Is it believed to be secure and represent the state-of-the-art in RSA-based signatures? I understand that RSA-PSS is a newer signature scheme, also standardized in PKCS #1. I found a memo from RSA recommending that people transi...
Is there any plot or visualizing program that can plot the distribution of a plaintext and then the distribution of the ciphertext after applying a ciphering encryption algorithm? I am interested from stream ciphers
Does it make an encrypted string more secure if I use SHA256(x) instead of x as the secret key for AES-128 encryption? I do know that SHA-256 produces 64 characters of hashed string regardless of what the input is. Will it still be accepted in AES as a key or it will cut it off to 32 characters? Also is it true that ea...
Is there any reference to check the list of encryption & signing algorithms which are compliant to FIPS 140-2. After an exhaustive search I could find only "AES". Any suggestions would be much appreciated.
I am working on a project that needs to securely authenticating one or more smartphone clients with a server running on a microcontroller so it has very limited resources. I have found plenty of lightweight HMAC hashing libraries. Therefore it seems to me that an HOTP authentication mechanism would be feasible on the...
If I don't err, in the literature a stream cipher is one in which each plaintext bit is processed individually, commonly via xor-ing with one bit of a random or pseudo-random bit stream, while a block cipher (in ECB mode, i.e. ignoring the add-on processing operations like CBC etc.) operates on n bits at a time with op...
Until what I have gotten is: A PRG is generator is a part of PRF that produces pseudo-random values for the function. PRF is semantically secure and has no worries of being invertible. Fine, then where is PRP used? What is PRP, where it comes to, how it benefits.
Asuming this scenario: Bob and Alice each have the public key of the other party for a D-H function and want to exchange data. Now, if they each generate their shared secret, is it safe to assume that: They can exchange messages safely without the fear of a MITM Can reuse the shared secret n times And what would be a...
Possible Duplicate: Taking advantage of one-time pad key reuse? How does one attack a two-time pad (i.e. one time pad with key reuse)? Denote C is cipher text, m is message, and PRG(k) is a psuedo randomize generator, generate an key. Because we have : C1 = m1 xor PRG(k) C2 = m2 xor PRG(k) --> C1 xor C2 = m1 xor ...
I have $\Pi=(Gen,Enc,Dec)$ and let it be semantically secure public-key encryption scheme. Security parameter is $n$, then the message space of plaintext is always $\lbrace 0, 1 \rbrace^n$. By using $\Pi$ I want to construct key exchange protocol $\Theta$. There should be 2 rounds (i.e. one for Alice and one for Bob). ...
Why we need bilinear groups of composite order? What's the special security property of the composite order group in comparison with one of prime order? To put it in another way when do we need composite order groups for bilinear maps and when prime order?
I have been wondering what approach to take in order to figure out what key was used to encrypt a message using the hill cipher. I know it is possible to obtain it even if it were just a known-plaintext attack, so it should be fairly possible for a chosen-plaintext one. I'm trying to figure it out with just intuition...
I just learned that using CBC encryption with an IV which is predictable is not secure. From what I understand, using certain plain texts, and then guessing the IV that it uses, the attacker can verify if the IV he guessed was right. How does this qualify as an attack?
At present, all FHE scheme are be constructed based on circuit approach. Can we construct fully homomorphic encryption scheme based on non-circuit approach? Is Polly cracker non-circuit approach ?
I can't get the point of prime order bilinear pairings:$\mathbb{G}\times\mathbb{G}\rightarrow\mathbb{G}_T$,$g=$ generator of $\mathbb{G}$ , $N=p*q$, $p$ and $q$ primes and $e(g,g)^N=1$. why $e(g,g)^N=1$ holds? Why is it 1?