instruction
stringlengths
15
30k
I am in the design phase of a secure chat application at the moment. I am trying to make this as secure as possible. The Serverprovider should not have access to the messagedata. So my idea was the following: - I have two base keys, one AES and one RSA Key. - The AES Key is derived from a password the user ente...
Is this chat protocol safe?
Some observations, though I would recommend against inventing your own protocol, at least for real world use: > When a new Chat group is formed, a random AES Key is generated and encrypted using each users public key. This means the protocol lacks [forward secrecy][1]. Anyone who compromises the private key of a ...
I was wondering if there's any string that has a hash equal to itself ? so that using any hash function (none specific), the hash would be equal to that string ? Example: `md5($string) == $string` This is not a school assignment, just curious and couldn't find any specific answer and not sure how to go and pro...
Is there a string that's hash is equal to itself?
Does it mean that when PPT attacker is breaking an indistinguishable based (equivalent with semantic security) game with non negligible probability that he is able to infer the secret keys either on symmetric or asymmetric encryption?
I'm trying to create a proof-of-work protocol for a proof-of-concept software, and it's basically something like this: privkey = that user's private key pubkey = that user's private key both are ECC message = "some message" difficulty = advertised difficulty log2 (sign(privkey, hash(...
According to [this][1] website, > In the ‘counter mode’ used in this implementation, a counter which > changes with each block is first encrypted, and the result is bitwise > xor’d with the plaintext block to get the ciphertext block (so the > plaintext is not actually directly encrypted). A unique ‘nonce’ is ...
Do AES CTR mode Encrypted file store header information in it?
>I would like to ask if that is true for every AES CTR mode implementation?, Doesn't have to be. You can store the nonce anywhere. You could even send it to the recipient via a different channel (e.g., email the ciphertext and use SMS to transmit the nonce). Storing it at the beginning has its advantages. For examp...
When plaintext padding is required, there are various commonly-used padding techniques. It seems the two most used approaches are : 1. Always add at least one byte of padding, and have every byte of padding represent the number of bytes of padding added; or else 2. Always add at least one byte of padding, and ha...
Nice question, however, you could have objects C0..C999 that you could still use to select a winner if you have an inversion of the algorithm, or just plenty of time before the lottery starts. You likely need a referee, or input from the participants from the lottery. A scheme could be that organizer selects (s...
I want to create a lottery that works like this: I choose a secret number A in the range [0:999] and publish an object B. People must try to guess the number A to win. When somebody wins, I want to publish an object C. The object C shall now together with B prove the existence of A, such that people know that A was det...
I'm trying to create a proof-of-work protocol for a proof-of-concept software, and it's basically something like this: privkey = that user's private key pubkey = that user's private key both are ECC message = "some message" difficulty = advertised difficulty log2 (sign(privkey, hash(...
According to the [**movable-type.co.uk**][1] website, > In the ‘counter mode’ used in this implementation, a counter which changes with each block is first encrypted, and the result is bitwise xor’d with the plaintext block to get the ciphertext block (so the plaintext is not actually directly encrypted). A unique...
Does AES CTR mode store header information in encrypted files?
I was wondering if there's any string that has a hash equal to itself, so that – when using any (none specific) hash function – the hash would be equal to that string? For example: md5($string) == $string Note that this is not an assignment or anything. I’m just curious and couldn't find any specific answe...
I came across some source code that loosely does the below in order to achieve a 32 bit hash. The input string is passed through MD5 to get 16 bytes Hash (as usual). Then the 16 bytes are split into 4 byte words . Each of these words are $\oplus$ with each other in order to get a final 4 byte word, this is considere...
Does this guarantee a unique 32 bit Hash?
I came across some source code that loosely does the below in order to achieve a 32 bit hash. The input string is passed through MD5 to get 16 bytes Hash (as usual). Then the 16 bytes are split into 4 byte words . Each of these words are $\oplus$ with each other in order to get a final 4 byte word, this is considere...
I came across some source code that loosely does the below in order to achieve a 32 bit hash. The input string is passed through MD5 to get 16 bytes Hash (as usual). Then the 16 bytes are split into 4 byte words . Each of these words are $\oplus$ with each other in order to get a final 4 byte word, this is considere...
Nice question, however, you could have objects $C_{0}\dots C_{999}$ that you could still use to select a winner if you have an inversion of the algorithm, or just plenty of time before the lottery starts. You likely need a referee, or input from the participants from the lottery. A scheme could be that organizer sel...
I'm currently using aes to encrypt/decrypt messages to and from a web service. When the user establishes a session he sends a random generated secret via rsa public key. This secret is used to establish a secure channel using AES (CBC). I'm using Rfc2898 to derive a key with a static salt (the salt is hardcod...
Well, we start with a small definition of XOR for bit strings larger than zero bits. $x$ and $y$ are bit strings with the lenght $n$ and $x_{k}$ denoting the $k^{th}$ bit (from $0$ to $lenght - 1$). $||$ represents concatenation and $\oplus$ means XOR. So we get: $$ x \oplus y = ((x_{0} \oplus y_{0}) || (x_{1} \opl...
I was wondering if there's any string that has a hash equal to itself, so that – when using any (none specific) hash function – the hash would be equal to that string? so that: hash(x) = x Note that this is not an assignment or anything. I’m just curious and couldn't find any specific answer or reference. ...
I'm looking into "bitcoin like" mining processes. Say a security process uses a hash of data as proof that the data was known at some point in time. From what I understand, hash functions are pseudorandomly generated based on the initial seed (the raw data). If the hash function is chaotic, then the seed data s...
Are hash functions chaotic?
In a custom protocol we want to replace an aged tiger32 based challenge response authentication. I suggested that we use something existing, so threw HMAC into the room. As per wikipedia it works as: $\textit{HMAC}(K, m) = H \left( (K \oplus opad) | H((K \oplus ipad) | m)\right) $ where $m$ would be the nonce. ...
Can adding nonces make challenge response authentications weaker?
Say you have a web application that's performing AES encryption. What sorts of side channel attacks should one keep an eye out for? Timing attacks affect RSA more than symmetric ciphers in-so-far as I know. Any ideas?
I didn't find anything about the exact way Crashplan encrypts files, only that it uses [Blowfish][1] in [CBC mode][2]. The block size of Blowfish is 64 bit, so there are $2^{64}$ different input blocks and the same number of output blocks. All in all $147573953$ terabytes of different output data. The problem with this...
Why was such a weak key schedule chosen for IDEA? The key schedule of IDEA works like this: Divide the key (128 bit) into 8 round keys, each 16 bit long. This are the first 8 "round" keys (6 keys per round). Rotate the original key by 25 bit to the left. Repeat this until we got the needed 52 round keys for 8.5 rou...
Is the 64-bit blocksize a fatal issue when encrypting TBs of data with Blowfish CBC?
As I understood in FEAL-4 it needs 4 pair of round keys. Which means that we need to launch Fk function 4 times, but the problem occures on the 2nd round. At first round we have original 64 bits key which is slicing on 32 bits and on the output of 1st round we have 32 bit key. But the 2nd,3rd,4th round also requires 64...
I'm using AES128-CTR for generating pseudo-random values, which is considered secure for up to 1MB (at least from what I've read). I simply encrypt a 128-bit little-endian counter, starting from 0. Should I use an IV? Should I start counting from a non-zero random value? Does it make any practical difference? ...
I'm using AES-CTR as a CSPRNG - Do I need an IV?
http://tools.ietf.org/html/rfc3447#appendix-B.1 id-sha256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 1 } How to read this definition? In another word, how to convert this into a bit stream? Thanks...
How costly is it to find millions of large prime number for RSA?
How costly is to find millions of large prime numbers for RSA?
I am looking in to AES-NI which now supported by intel's new CPU's And I have ready few papers which states that AES-CBC works faster with AES-NI. But I am unable to understand how exactly AES-NI works ? AFAK, AES-CBC encryption is sequential, so how AES-NI makes it so faster? (Also even after using AES-N...
How exactly AES-NI works ?
It's a hardware implementation of something that typically needs to be written in software. Imagine if nobody had hardware multiplication circuits and everybody had to write software implementations of multiplication. Then a new processor came out that had a dedicated circuit to perform multiplication. Obviously a circ...
I am looking in to AES-NI which is now supported by many new CPU's and I have read a few papers which states that AES-CBC works faster with AES-NI, but I am unable to understand how exactly AES-NI works. As far as I know, AES-CBC encryption is sequential, so how does AES-NI make it so faster? (Also even after u...
How exactly does AES-NI work?
I have the following piece of .NET code (see below). I know that DES is not quite secure, I saw that [MSDN does not recommend using DES][1], only for compatibility with legacy programs. I also saw that some people say that IV has to be regenerated every time new message is encrypted. Q: How secure is the code? Assum...
Is .NET DESCryptoServiceProvider secure in this case?
I have an assignment in cryptography. I am not asking here answer, but meaning of question. This is a question : > 2.4 The following ciphertext was generated using a simple substitution algorithm. 53‡‡†305))6*;4826)4‡.)4‡);806*;48†8¶60))85;;]8*;:‡*8†83 (88)5*†;46(;88*96*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8¶8* ;406...
What is meaning of "Decipher the rest of the message by deducing additional words"?
Let suppose that the sizes of factors $p$ and $q$ are $b$ bits. We construct two RSA numbers $n$, $n'$ of same sizes. Can we say that the duration to break these two numbers is two times the duration to break one number?
I've just read a paper from 2004 which stated that the RC4 encryption algorithm was restricted to a 40 bit key size when exported from the USA; however the reference for this information (Applied Cryptography - Schneieir) was published in 1996. Here's the link to the paper: http://ieeexplore.ieee.org/xpl/login.jsp?t...
Do Export Restrictions Still Apply To The Key Length of RC4?
Recently, a new cipher called [Spritz](http://people.csail.mit.edu/rivest/pubs/RS14.pdf) has been released by Ronald L. Rivest and Jacob Schuldt. It should be a "drop-in replacement" for RC4. There are many differences to RC4, Spritz is "spongy" and also has a complete different way to handle the key setup. But sti...
Security analysis of Spritz?
Could anyone explain how secure is bit level permutation? What is the most serious threat against the security of this kind of cipher? Thank you
I've just read a paper from 2004 which stated that the RC4 encryption algorithm was restricted to a 40 bit key size when exported from the USA; however the reference for this information (Applied Cryptography - Schneieir) was published in 1996. Here's the link to the [paper "The effectiveness of brute force attacks ...
The key space for DES is far too small (56 bits). Therefore, any use of DES is not secure. It doesn't matter what mode you use. If the attacker has one plaintext, ciphertext pair, they can brute force the key space and recover the key in a feasible amount of time ([24 hours](https://www.cloudcracker.com/blog/2012/07/29...
The key space for DES is far too small (56 bits). Therefore, any use of DES is not secure. It doesn't matter what mode you use. If the attacker has one plaintext, ciphertext pair, they can brute force the key space and recover the key in a feasible amount of time ([24 hours](https://www.cloudcracker.com/blog/2012/07/29...
I have a question here asking the following: **Why do block ciphers need the use of blocking modes?** 1) To encrypt messages larger than the size of the block. 2) To avoid having the same block ciphered into the same stream of bits twice. 3) To be able to parallelize some of the operations of ciphering or d...
Assume that we have this 256bit key: 15FC0D48 D7F8199C BE399183 4D96F327 10000000 00000000 00000000 On first 0-7 keys we can't apply formula wi=(wi-8 xor wi-5 xor wi-3 xor wi-1 xor phi xor i)<<<1 since on 0 we have negative non exist value 0-8=-8. So currently {k0,k1,k2,k3}=S3{w0,w1,w2,w3} {k4,k5,k6,k7}=S2{w4,w...
Is there are any possibility to see trace(example) of Serpent Encryption/Decryption on concrete plaintext/key example, (not code implementation) or at least animation of steps. During reading of Serpent I found article on IDEA Encryption with full round description on concrete plaintext https://ru.wikipedia.org/wiki/ID...
I have a question here asking the following: > **Why do block ciphers need the use of blocking modes?** > 1. To encrypt messages larger than the size of the block. 2. To avoid having the same block ciphered into the same stream of bits twice. 3. To be able to parallelize some of the operations of ciphering or d...
MD5 processes a 512 bit block and produces a 128 bit (16 btye) message digest expressed as 32 digit hexidecimal value For example if I hash the word "how" using MD5 , i get the following hash value db88a0257c220dbfdd2e40f6152d6a8d The word "how" is represented in 3 btyes which is 24 bits. How does MD5 proc...
To answer the question "why does a block cipher use a Mode of Operation", we need to first examine the question "what is a block cipher?" A block cipher is a keyed operation that converts a string of N bits to a string of N bits (where N is usually fixed by the block cipher; for AES, N=128), in a way that, without t...
> I have looked at some attacks on RC4 and be curious if some of them can be applied to Spritz as well. Does anybody else has analysed Spritz so far? Or is it far too early for results against Spritz? No third party analysis. Probably way too early. (Even the paper you linked is unpublished.) The answer may of cours...
MD5 processes a 512-bit block and produces a 128-bit (16 byte) message digest often expressed as 32-digit hexadecimal value For example if I hash the word "how" using MD5 , I get the following hash value db88a0257c220dbfdd2e40f6152d6a8d The word "how" is represented in 3 bytes which is 24 bits. How does MD...
I want to create a lottery that works like this: I choose a secret number A in the range [0:999] and publish an object B. People must try to guess the number A to win. When somebody wins, I want to publish an object C. The object C shall now together with B prove the existence of A, such that people know that A was det...
In a _chosen-ciphertext attack_, the attacker is assumed to have a way to trick someone who knows the secret key into _decrypting_ arbitrary message blocks and tell him the result. The attacker can choose some arbitrary nonsense as an "encrypted message" and ask to see the (usually) different nonsense it decrypts to, a...
Is it possible to demonstrate that md5(x) != x for any x?
Assuming all inputs are same length as rate except last can be shorter. Is it necessary to pad every input (not just last) to sponge for authenticated encryption to be secure? Is this just, because it is wrapped around Absorb and Squeeze? What is purpose of frame bit in SpongeWrap?
Why was such a weak key schedule chosen for IDEA? The key schedule of IDEA works like this: Divide the key (128 bit) into 8 round keys, each 16 bit long. This are the first 8 "round" keys (6 keys per round). Rotate the original key by 25 bit to the left. Repeat this until we got the needed 52 round keys for 8.5 rou...
Where did SHAKE128 and SHAKE256 originate from? I am trying to find them in the [original Keccak documentation][1] but can't find them. Is it some special mode of Keccak referenced in the documentation? Or something invented by NIST and added to the SHA3 standard? [1]: http://keccak.noekeon.org/Keccak-referen...
Where did the SHAKEs come from in SHA3?
Where did SHAKE128 and SHAKE256 originate from? I am trying to find them in the [original Keccak documentation][1] but can't find them. Is it some special mode of Keccak referenced in the documentation? Or something invented by NIST and added to the SHA3 standard? Any public cryptanalysis done on them? ...
how can convert Affine to Jacobian coordinates?
> Where did SHAKE128 and SHAKE256 originate from? They follow from the general properties of the [sponge construction][1]. A sponge function can generate an arbitrary length of output. The [submission][2] of Keccak to the SHA-3 competition proposed a single "XOF" (extendable-output function) with a user defined leng...
I'm trying to understand, why the Filesize of a Caesar Cipher encrypted foo.txt.zip File is smaller than a Caesar cipher encrypted foo.txt File. For example: Foo.txt size: 90bytes foo.txt.Caesar.enc output File: 92bytes (Here every character is shifted with the same size so the bytelength is nearly the same) ...
TOTP (Time-based One-Time Password) Algorithm is used in Two factor authentication. I understand the algorithm and that current time is used as a variable to generate a token. Wiki page for reference: http://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm My question is, can current time be faked? Su...
Is it possible to 'fake' time for TOTP? (Time-based One-time Password)
Linear functions when expressed as polynomials only have terms of degree 1 or 0. Non-linear functions have at least one term of degree 2 or higher. For example, here is a linear boolean function: $y = ax + bz + c$, where $y$ is the output bit, $x$ and $z$ are input variables, and $a$, $b$, and $c$ are constants. Noti...
Leo Ducas and Daniele Micciancio's recent paper ["FHE Bootstrapping in less than a second"](http://eprint.iacr.org/2014/816.pdf) gave an exciting result that one can compute the `atom operation' of Fully Homomorphic Encryption (i.e. NAND-and-Recrypt) within 1 second without loss of security. I am trying to figure out h...
How to compute the decompositions used in fast FHE bootstrapping?
Linear functions when expressed as polynomials only have terms of degree 1 or 0. Non-linear functions have at least one term of degree 2 or higher. For example, here is a linear boolean function: $y = ax + bz + c$, where $y$ is the output bit, $x$ and $z$ are input variables, and $a$, $b$, and $c$ are constants. Noti...
In the last couple weeks I've become pretty well-acquainted with the recent work in this area. I also built a prototype order-preserving encryption scheme following the algorithms presented in 'Order-preserving Symmetric Encryption' by Boldyreva et al. I'll take a stab at explaining the method I just implemented, which...
I have a rather silly question regarding the comparison of RSA with ElGamal over integers. If you want to compare their performance in the same level of security, does the modulus of both of them need to be the same size, or does RSA have to be double the size of ElGamal?
How do RSA and ElGamal key sizes compare?
Assuming all inputs are same length as rate except last can be shorter. Is it necessary to pad every input (not just last) to sponge for authenticated encryption to be secure? Is this just, because it is wrapped around Absorb and Squeeze? What is purpose of frame bit in [SpongeWrap][1]? [1]: http://sponge....
> Is it necessary to pad every input (not just last) to sponge for authenticated encryption to be secure? Yes. The purpose of the padding is to make every possible input unique. So a full block must result in a different bitstring than any padded non-full block. There is no way to pad only the incomplete block and ...
Is there any published work on implementing a online auction, which uses "remote coin flip" to prevent auctioneer cheating when choosing winner and bid value? Is there any possible way to use remote coin flip for a such scenario?
Let $H_1$, $H_2$ be keyed hash functions (e.g. $H_i(x) = SHA_{256}(s_i||x)$ for pseudorandom $s_1$, $s_2$). Let $s_n = H_1^k(s_0)$, $k_n = H_2(s_n)$, where $s_0$ is a secret (pseudorandomically chosen from a distribution). Is using $k_n$ as a sequence of forward-secure keys secure (i.e., forgetting $s_n$ when cha...
Let $H_1$, $H_2$ be keyed hash functions (e.g. $H_i(x) = SHA_{256}(s_i||x)$ for pseudorandom $s_1$, $s_2$). Let $s_n = H_1^k(s_0)$, $k_n = H_2(s_n)$, where $s_0$ is a secret (pseudorandomly chosen from a distribution). Is using $k_n$ as a sequence of forward-secure keys secure (i.e., forgetting $s_n$ when changin...
Is there any published work on implementing a online auction, which uses "remote coin flip" to prevent auctioneer cheating when choosing winner and bid value? Is there any possible way to use remote coin flip for a such scenario? Note: in a [Vickrey auction][1], bidders submit written bids without knowing the bid o...
I want to use Salsa 20 in Java, so I downloaded Bouncy Castle, and... it makes no sense to me. I've got it working, but most of my choices were essentially random. But I can't see there anything leading me to the right path. The interface `CipherParameters` accepts nearly any nonsense and a key size of 257 bits works p...
I want to use Salsa 20 in Java, so I downloaded Bouncy Castle, and... it makes no sense to me. I've got it working, but most of my choices were essentially random. But I can't see there anything leading me to the right path. The interface `CipherParameters` accepts nearly any nonsense and a key size of 257 bits works p...
I know there are XEX, XTS and other ways to add tweak to block cipher without modifying cipher itself. However they are quite slow and/or complex. If we assume we have a secure block cipher round function (like AES) with pseudo-independent round keys (generated with stream cipher). Is it safe to add tweak with same ...
How to calculate the entropy of passwords?
I know there are XEX, XTS and other ways to add tweak to block cipher without modifying cipher itself. However they are quite slow and/or complex. If we assume we have a secure block cipher round function (like AES) with pseudo-independent round keys (generated with stream cipher). Is it safe to add tweak with same ...
I am looking towards using NSS in a Linux application that makes use of a TPM (HSM). So, I am checking the support of [PKCS 11][1] in NSS, at least for the management of Elliptic Curve keys, signature with EC keys, RNG. I read contradictory things. First, on the NSS site, it is said that only a subset of PKCS #11 is...
Does NSS fully implement PKCS 11?
I've been looking at the paper of Boneh, Boyen, Goh https://eprint.iacr.org/2005/015.pdf which contains a general theorem about the advantage of an attacker in the generic group model. It seems to be based on the idea that in the generic bilinear group model, we can only compute things that are linear combination...
I've been looking at the paper of Boneh, Boyen, Goh [*Hierarchical Identity Based Encryption with Constant Size Ciphertext*](https://eprint.iacr.org/2005/015.pdf) which contains a general theorem about the advantage of an attacker in the generic group model. It seems to be based on the idea that in the generic bilinea...