instruction
stringlengths
15
30k
> It is possible to check $a \in \mathrm{QR}_p \text{ iff } a^{(p-1)/2} \equiv 1\ (\bmod\ p)$ if $p$ is a prime. Yes, you have already written down the check, which is known as [Euler's criterion](http://en.wikipedia.org/wiki/Euler's_criterion). > $n$ is a large RSA modulus. Is it also possible to check if $a \in...
> When I want to encrypt chat messages (in ascii) before sending, > whether it brings some bit of security if I add some extra bytes to > the message or shuffle it in some way? I can even try to make data to > look like uniform distribution. I recommend to encode your chat messages with base64 before encrypting a...
> When I want to encrypt chat messages (in ascii) before sending, > whether it brings some bit of security if I add some extra bytes to > the message or shuffle it in some way? I can even try to make data to > look like uniform distribution. I recommend to encode your chat messages with base64 before encrypting a...
DrLecter's answer is right. But here I just to give a supplementary answer to this question. If we consider this problem in signed quadratic residues ,then it is the other way around.signed quadratic residues is defined as $$\mathbb{QR}_N^+=\{|x|:x\in\mathbb{QR}_N\}$$ where $|x|$ is the absolute value of $x$, and i...
DrLecter's answer is right. But here I just to give a supplementary answer to this question. If we consider this problem in signed quadratic residues ,then it is the other way around.signed quadratic residues is defined as $$\mathbb{QR}_N^+=\{|x|:x\in\mathbb{QR}_N\}$$ where $|x|$ is the absolute value of $x$, and i...
I've already sent my correct solution to [a homework exercise from Dan Boneh's _Introduction to Cryptography_ class on Coursera](https://class.coursera.org/crypto-preview/quiz/attempt?quiz_id=18): > "Let us see what goes wrong when a stream cipher key is used more than once. Below are eleven hex-encoded ciphertexts ...
> It is possible to check $a \in \mathrm{QR}_p \text{ iff } a^{(p-1)/2} \equiv 1\ (\bmod\ p)$ if $p$ is a prime. Yes, you have already written down the check, which is known as [Euler's criterion](http://en.wikipedia.org/wiki/Euler's_criterion). > $n$ is a large RSA modulus. Is it also possible to check if $a \in...
Possible to check if $a \in \mathrm{QR}_n$?
I have some encrypted files with double-key. I know public key and don't know private key. Can I obtain the private key (and decrypt all files) using two version of one file - crypted and decrypted? And if yes, how? Thanks a lot.
Is it possible to decrypt double-key crypted file knowing public key and a having one or more original files?
This has been basically asked already: [Should we trust the NIST recommended ECC parameters?][1] History ----- Once it was found that NSA allegedly had inserted backdoor to a cryptographic standard, people started thinking what standard it was. The most common guess is that the Dual EC DRBG is the backdoored ...
What is the difference between homomorphic encryption and homomorphic signature?
java SecureRandom is meant to be cryptographically secure, and I know part of that means that the output should not be usable to predict further output. Though, admittedly, my knowledge in the area is limited, and I'd like to test the limits to get an idea of how secure java's SecureRandom really is. So let's say I...
I know there are already of few questions about this and I'm working with the advices that were given but I still doubt my approach is the fastest, so I'd really appreciate if you helped me find a faster way. What I want to do: I have 2 encrypted messages (about 200 characters each in HEX) and I want to decrypt the...
One-Time-Pad with key-reuse: Faster way of decrypting?
java SecureRandom is meant to be cryptographically secure, and I know part of that means that the output should not be usable to predict further output. Though, admittedly, my knowledge in the area is limited, and I'd like to test the limits to get an idea of how secure java's SecureRandom really is. So let's say I...
If I understand your scheme correctly, then there is no need for "RSA" (or any public key scheme for that matter). The only exception is the "new user has to be added", which does not really need the public key scheme. First, you assume that only authenticated users have access, and usually this leads to a secure, auth...
We have a native C++ application that supports Windows XP SP3. Recently we've decided to change our crypto algorithms to FIPS 140-2 compliant ones. We are planning to use the following algorithms in Enhanced RSA and AES Cryptographic Provider: 1) AES256 for encryption 2) SHA1 for hashing 3) RSA for key ex...
I can't help you with your Windows question, however I can chime in on FIPS: > Is it going to be FIPS 140-2 compliant? It might not be. The problem is the "SHA1 for hashing"; SHA1 is no longer approved as a collision resistant hash function. On the other hand, HMAC-SHA1 is still approved as a Message Authentica...
When performing a key search I've always wondered how you reliably detect a successful decryption once you hit the right key. I assume that you have to analyze the data and look for patterns: words, letter frequency, known file headers, statistical properties and so forth. Is this a correct assumption and, if so, ha...
We have a native C++ application that supports Windows XP SP3. Recently we've decided to change our crypto algorithms to FIPS 140-2 compliant ones. We are planning to use the following algorithms in Enhanced RSA and AES Cryptographic Provider: 1. AES256 for encryption 2. SHA1 for hashing 3. RSA for key exchange...
I need to generate a EDH group on the fly in one has not been specified in a config file. Diffie-Hellman is kind of expensive in terms of computation, so I'd like to reduce the cost if possible. Is there any benefit to selecting a generator of 5 versus 3 or 2 in an attempt to keep the costs minimized? Is this a misg...
When performing a key search, I've always wondered how you reliably detect a successful decryption once you hit the right key. I assume that you have to analyze the data and look for patterns: words, letter frequency, known file headers, statistical properties and so forth. Is this a correct assumption and, if so, h...
Oracle DBMS offer builtin random number generator (pseudo to be accurate). DBMS_RANDOM is one the available package, but is however considered as insecure for cryptography. Do we happen to know the algorithm used by this method ? and what are the criteria to consider a PRNG as non fit for cryptography ?
Oracle DBMS_RANDOM algorithm?
My [current encryption format](https://github.com/RNCryptor/RNCryptor-Spec/blob/master/RNCryptor-Spec-v3.md) computes two random PBKDF2 salts (encryption and HMAC, 8 bytes each) and also a random IV (16 bytes) to use with AES-CBC. This adds 32 bytes to the final message. Plus it eats three random numbers worth of entro...
My [current encryption format](https://github.com/RNCryptor/RNCryptor-Spec/blob/master/RNCryptor-Spec-v3.md) computes two random PBKDF2 salts (encryption and HMAC, 8 bytes each) and also a random IV (16 bytes) to use with AES-CBC. This adds 32 bytes to the final message, which can be a lot for short messages (plus anot...
Can you help me understand the following reasoning: If Alice sends Bob a message and that message is encrypted with two keys simultaneously: a symmetric key (Ks) and Bob's public key. The symmetric key (Ks) is also sent to Bob, encrypted with the private key of Alice. The conclusion reached from this exchange of mess...
Messages exchanged between Bob Alice are encrypted safe?
I tried asking this on stackoverflow because I thought it might be a simple coding question and didn't want to clutter up this amazing stack, but I received no responses. CodesInChaos showed me that the proper implementation of Curve25519 for digital signatures is Ed25519 and also informed me that [this implementati...
How can k3d3/ed25519-java's performance be improved?
Oracle DBMS offer builtin random number generator (pseudo to be accurate). DBMS_RANDOM is one the available package, but is however considered as insecure for cryptography. Do we happen to know the algorithm used by this method ?
In many crypto papers I see they use a Real World / Ideal World Paradigm. However, I have never see the source code of such Simulators that try to simulate the adversary. Could somebody point me to source code that simulates an adversary in the ideal world? How does this code look like ? An example of a paper th...
Where can I find source code for ideal world simulation?
I'm new to cryptography as the question might sound plain. I want to know when exactly entropy from `/dev/random` is needed for a crypto process? Is it only needed for the key generation or is it also needed for the encryption process itself? Regarding to: * using OpenSSL to encrypt a file with Rijndael-256 * usin...
Bob needs proof that Alice is authentic: A-Open Connection-Cert partial random key->B Both keys combine to form an access key. Standard one-way authentication protocol only requires submitting a correct password once, in order to gain access and control. By randomizing part of Alice's password, significantly reduc...
Consider the following scenarios: * using OpenSSL to encrypt a file with Rijndael-256 * using LUKS to encrypt a hard-drive that is used every day Exactly when is entropy from `/dev/random` needed for a crypto process? Is it only needed for the key generation or is it also needed for the encryption process itsel...
I'm looking around for publicly published work on factorization of large numbers using distributed systems of any kind. So far I've come across [this][1] which looks like an interesting read. Are there any papers in particular that I should be reading? I'm adding "distributed-decryption" as a tag as I couldn't fi...
Oracle DBMS offer builtin random number generator (pseudo to be accurate). DBMS_RANDOM is one of the available packages, it is however considered as insecure for cryptography. Do we happen to know the algorithm used by this method ?
I'm looking around for publicly published work on factorization of large numbers using distributed systems of any kind. So far I've come across the PDF ["Mapreduce for integer factorization" by Javier Tordable][1]" which looks like an interesting read. Are there any papers in particular that I should be reading? ...
Distributed integer factorization?
Let's say I have a list of several million numbers, with only 6-9 digits of secret information per number (this means that an attacker might efficiently guess the other digits). I have to store the list in an unreadable format and when given a new number I want to efficiently know if I have the number in my list or not...
Can you help me understand the following reasoning? If Alice sends Bob a message and that message is encrypted with two keys simultaneously: a symmetric key (Ks) and Bob's public key. The symmetric key (Ks) is also sent to Bob, encrypted with the private key of Alice. The conclusion reached from this exchange of mes...
1) i know how to do multiplication over GF(2^8).Logic is, uint8_t gmul(uint8_t a, uint8_t b) { uint8_t p=0; uint8_t carry; int i; for(i=0;i<8;i++) { if(b & 1) p ^=a; carry = a & 0x80; a = a<<1; if(carry) a^=0x1b; ...
In the paper "[Multiparty Computation Secure Against Continual Memory Leakage][1]" on pg. 1239 the footnote at the bottom points out the difference between $joint$ leakage and $disjoint$ leakage. The authors say the weakly leakage resilient protocol of BGG+11 cannot be directly used because it only applies to $joint$ ...
1. I know how to do multiplication over $GF(2^8)$. Logic is... uint8_t gmul(uint8_t a, uint8_t b) { uint8_t p=0; uint8_t carry; int i; for(i=0;i<8;i++) { if(b & 1) p ^=a; ...
Multiplicative inverse in $GF(2^8)$?
I'm adding some Diffie-Hellman groups to a program as specified in [RFC 3526, More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)][1]. When I test some of the group parameters per OpenSSL's `DH_check`, a result is returned that states 2 is not a suitable generator for Group 5 or the...
Diffie-Hellman Generator Check (when g = 2, must p mod 24 == 11?)
I'm adding some Diffie-Hellman groups to a program as specified in [RFC 3526, More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)][1]. When I test some of the group parameters per OpenSSL's `DH_check`, a result is returned that essentially states: 2 is not a suitable generator for G...
Diffie-Hellman Parameter Check (when g = 2, must p mod 24 == 11?)
Passwords hashed under Unix/Linux systems can use several hashing algorithms. ID | Method ------------------------------------------------- 1 | MD5 2a | Blowfish (on some Linux distributions) 5 | SHA-256 (since glibc 2.7) 6 | SHA-512 (since gl...
Passwords hashed under Unix/Linux systems can use several hashing algorithms. ID | Method ------------------------------------------------- 1 | MD5 2a | Blowfish (on some Linux distributions) 5 | SHA-256 (since glibc 2.7) 6 | SHA-512 (since gl...
I have a system where I am transmitting json messages securely (using for example AES-128), where each message has the same format. For example {"d":{"status":"success"}} {"d":{"error":"Message length too long"}} Where every plain-text message is guaranteed to start with `{"d":{` and end with `}}...
If the attacker knows parts of the plaintext, does it expose the key?
Actually, there is no major difference between $p \equiv 23\ (\bmod\ 24)$ vs $p \equiv 11\ (\bmod\ 24)$; any minor difference boils down to "do you prefer the DH shared secret to be limited to half the possible values; or do you prefer to leak a bit of the secret exponents?". OpenSSL prefers to leak one bit; the R...
I installed djigzo on my android phone and I want to use it for smime mail. I don't know the difference between choosing sha256withrsa and sha256withrsaencryption digest algorithms in the settings. I've searched with google and I only found OIDs and code samples. Can you enlighten me?
what is the difference between sha256withrsa and sha256withrsaencryption digest algorithms?
Probably a dumb question, but I've read the Bitmessage whitepaper and I found it rather lacking on the details. But it promises anonymous routing, so can it be considered a variation on Mix networks, where each peer acts as a mix node?
Is Bitmessage a Mix network?
I've been studying crypto for almost a year now, implementing algorithms, reading books, studying code, etc. The deeper I go in, the more I realize there is; I feel like I've just barely scratched the surface (if even that). Why do I start the word buffers in MD5 with those values specifically? What in the world mot...
I plan to build my own crypto library. The project will be primarily for me to learn (and if useful for no other purpose, that is fine). In the past I have implemented a few hashes, and AES quite a few times while learning about it, but those projects were solely for me to learn, not for any field use. With this one I'...
I have large files which are broken into blocks of 512 KB and uploaded to a server. In my DB I store the IV, and the user knows the security key themselves. When downloading, I use the same IV and key. However, is it insecure running AES-CBC on each different block with the same IV? Won't this give away information...
AES-CBC and IV -- Encrypting multiple blocks of a file with the same IV?
>Suppose the attacker knows [some part of the plaintext] >Does this reveal information that could lead to a security exploit Given the rest of your notes, that you're using CBC mode (and depending on how you manage the IV), then yes, it can allow the attacker to modify messages such that the attacker can control ...
Probably a dumb question, but I've read the [Bitmessage whitepaper][1] and I found it rather lacking on the details. But it promises anonymous routing, so can it be considered a variation on Mix networks, where each peer acts as a mix node? [1]: https://bitmessage.org/bitmessage.pdf%E2%80%8E
I installed djigzo on my android phone and I want to use it for smime mail. I don't know the difference between choosing `SHA256WITHRSA` and `SHA256WITHRSAENCRYPTION` digest algorithms in the settings. My online search only returned OIDs and code samples. Can you enlighten me?
What is the difference between SHA256WITHRSA and SHA256WITHRSAENCRYPTION digest algorithms?
I have large files which are broken into blocks of 512 KB and uploaded to a server. In my DB I store the IV, and the user knows the security key themselves. When downloading, I use the same IV and key. However, is it insecure running AES-CBC on each different block with the same IV? Won't this give away informati...
Probably a dumb question, but I've read the [Bitmessage whitepaper][1] and I found it rather lacking on the details. But it promises anonymous routing, so can it be considered a variation on Mix networks, where each peer acts as a mix node? [1]: https://bitmessage.org/bitmessage.pdf
I'm adding some Diffie-Hellman groups to a program as specified in [RFC 3526, More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)][1]. When I test some of the group parameters per OpenSSL's `DH_check`, a result is returned that essentially states: 2 is not a suitable generator for G...
java SecureRandom is meant to be cryptographically secure, and I know part of that means that the output should not be usable to predict further output. Though, admittedly, my knowledge in the area is limited, and I'd like to test the limits to get an idea of how secure java's SecureRandom really is. So let's say I...
java SecureRandom is meant to be cryptographically secure, and I know part of that means that the output should not be usable to predict further output. Though, admittedly, my knowledge in the area is limited, and I'd like to test the limits to get an idea of how secure java's SecureRandom really is. So let's say I...
java SecureRandom is meant to be cryptographically secure, and I know part of that means that the output should not be usable to predict further output. Though, admittedly, my knowledge in the area is limited, and I'd like to test the limits to get an idea of how secure java's SecureRandom really is. So let's say I...
java SecureRandom is meant to be cryptographically secure, and I know part of that means that the output should not be usable to predict further output. Though, admittedly, my knowledge in the area is limited, and I'd like to test the limits to get an idea of how secure java's SecureRandom really is. So let's say I...
java SecureRandom is meant to be cryptographically secure, and I know part of that means that the output should not be usable to predict further output. Though, admittedly, my knowledge in the area is limited, and I'd like to test the limits to get an idea of how secure java's SecureRandom really is. So let's say I...
For P2P authentication, you can go for [web of trust][1] concept. Simply this means, if someone is trusted by people you can trust, you can also trust that unknown person. In OpenPGP, a certificate can be signed by other users who trust the association of that public key with the person or entity listed in the certific...
Actually, I'm not familiar to how identity-based and certificate-based systems work, so ,can anyone give me a detail and comprehensive answer to this question? Moreover, in what environments the identity-based systems is recommended(or needed) and why?
what's the advantages of identity-based systems over certificate-based ones?
I have a webserver which support only TLS 1.0 Which is the better cipher in this group for the best security? TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) ...
I have a webserver which support only TLS 1.0 Which is the better cipher in this group for the best security? TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) ...
I have a webserver which support only TLS 1.0 Which is the better cipher in this group for the best security? TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a) TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014) TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009) TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013) ...
**Public key crypto vs. identity-based crypto made short:** In traditional **public key cryptography**, a user $A$ generates a private/public key pair $(sk_A,pk_A)$ and since this key pair has absolutely no indication to which indentity (user $A$) it belongs, it is necessary to *certify* the public key, i.e...
i’m a graphic design student and for my information graphic project a have chosen the topic of the history of encryption and how the security level developed over the centuries. It’s basically a information graphic to make people like me aware of encryption and its importance in times like these (NSA e.g.). So i take s...
**Public key crypto vs. identity-based crypto made short:** In traditional **public key cryptography**, a user $A$ generates a private/public key pair $(sk_A,pk_A)$ and since this key pair has absolutely no indication to which indentity (user $A$) it belongs, it is necessary to *certify* the public key, i.e.,...
**Public key crypto vs. identity-based crypto made short:** In traditional **public key cryptography**, a user $A$ generates a private/public key pair $(sk_A,pk_A)$ and since this key pair has absolutely no indication to which indentity (user $A$) it belongs, it is necessary to *certify* the public key, i.e.,...
**Public key crypto vs. identity-based crypto made short:** In traditional **public key cryptography**, a user $A$ generates a private/public key pair $(sk_A,pk_A)$ and since this key pair has absolutely no indication to which indentity (user $A$) it belongs, it is necessary to *certify* the public key, i.e.,...
In FIPS 186-3 appendix D.2 "implementation of Modular Arithmetic" The show short cuts for solving B = A mod m for select Curves. How would you go about determining a valid short cuts for the various curves? If I wanted to practice on using a small finite field e.g. 23, 31 something that could be solved by hand. A...
In what way is XXTEA really vulnerable?
I am a graphic design student and for my information graphic project I have chosen the topic of the history of encryption and how the security level developed over the centuries. It’s basically an information graphic to make people like me aware of encryption and its importance in times like these (see: news about the ...
Calculating amount of time of brute forcing several encrpytions?
In [FIPS 186-3](http://csrc.nist.gov/publications/fips/fips186-3/fips_186-3.pdf) appendix D.2 "implementation of Modular Arithmetic", they show shortcuts for solving $$B = A \mod m$$ for select Curves. How would you go about determining a valid short cuts for the various curves? If I wanted to practice on usin...
Implementation of modular arithmetic?
I have a program (that people can download and run on their own computers) whereby it will calculate a *value*. The user can then publicly broadcast this *value*, along with a *verification-value*, and other people will verify that the *value* is accurate and unmodified because it agrees with the *verification-value*...
How to ensure that a "received value" is not altered?
I have a program (whereby people can download and run on their own computers) that will calculate a couple of unknown *values* each day. For simplicity sake, let's assume that the calculation is simply `Rand(0, 1)`. The program will run and the user will get a value e.g. `0.230957203975`. He will then broadcast this...
What is significance of recovering the chaining value of a compression function, when the message and its output are known? in other words, if a cmpression function $CF$ takes a chaining value $h_{in}$ and a message $m$ as inputs and outputs $h_{out}$. $h_{out}=CF(h_{in}, m)$ Is it a bad property if given $m$ and...
What is significance of recovering the chaining value of a hash compression function?
I've always been curious as to how Pay-TV and other Conditional Access systems actually stay secure for any amount of time, given that they are usually one way and (I'm assuming) use symmetric keys for encrypting the video/data streams. Given that the decoder MUST be able to learn the control word keys via some mean...
I've always been curious as to how Pay-TV and other Conditional Access systems actually stay secure for any amount of time, given that they are usually one way and (I'm assuming) use symmetric keys for encrypting the video/data streams. Given that the decoder MUST be able to learn the control word keys via some mean...