Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [algorithm-design]

Design of cryptographic primitives (algorithms), like block ciphers, stream ciphers, random-number generators, hash functions, MACs, key exchanges, public-key encryption or signature schemes. Also tag with the relevant type of primitive. If you ask about a known existing algorithm, also tag with its name.

Filter by
Sorted by
Tagged with
0
votes
3answers
541 views

Key lengths of asymmetric encryption: ElGamal and ECC

Recently I have been researching asymmetric encryption algorithms for a class, I cannot find any information anywhere on the key lengths used in any of the algorithms I'm looking into (ElGamal & ...
1
vote
0answers
80 views

Are there any pseudo-random permutation algorithms for any number of words in the input independently of the word size (as in MD6 core function)?

I am interested in fixed pseudo-random permutation algorithms that are defined for any number of words in the input (but there might be some minimal number of words, e.g. 8), where the word size may ...
3
votes
2answers
5k views

What happens if a SHA-256 input is too long (longer than 512 bits)?

What I understand is: When we parse a message into 512 bit message blocks. Then we extend the first message block to 64 entry array and start with the compression function. What happens if the ...
2
votes
1answer
608 views

Does there exist a cryptographic algorithm for comparing 2 encrypted strings

I would like to know if there exists algorithms A and B such that the following is possible. Say Alice has 2 binary strings S1 and S2 both of length n and 2 keys k1 and k2. She encrypts each string ...
-2
votes
1answer
90 views

Would fragmenting data into several independent secured files would make a system Quantum-Resistant?

In 2018 IBM is making available the first quantum computers. This can be a disaster for most security systems based on computing power. Could this type of scheme bring a solution to this problem ? ...
1
vote
3answers
1k views

On what basis are block sizes chosen?

Sha1/0 (160 bits output), md5(128 bits output) has block size of 512 bits. Gost has 256 bits. What is the reason behind having it specifically 512/256/1024 bits? What are the various factors which ...
4
votes
2answers
239 views

Why are theoretical hash constructions based on the hardness of the discrete logarithm problem not really used in practice?

In an old 2010 Q&A at StackOverflow, Pornin states: … a good hash function "should not" allow a property such as surjectivity to be actually proven. This makes sense to me when looking at, for ...
10
votes
3answers
458 views

Has any crypto hash function been proven to be surjective?

This answer claims that "it is not proven that all outputs of SHA-1 are possible." Has any crypto hash function been proven to produce all possible outputs (i.e., to be surjective over the codomain of ...
1
vote
0answers
165 views

What steps are needed for fully homomorphic encryption? [closed]

In my project work, I want to encrypt the keywords extracted from certain documents by using fully homomorphic encryption. What are the algorithmic steps to perform fully homomorphic encryption on ...
1
vote
0answers
187 views

What cryptographic primitives use AES or its Round function?

I have found the following two block/stream ciphers or Hash Construction that make use of AES or its round functions A New 128-bit Key Stream Cipher LEX 3D: A Three-Dimensional Block Cipher ALE ASC-...
1
vote
1answer
589 views

How exactly is the input message of SHA-256 (pre-)processed?

I’m very interested how SHA-256 handles messages, but I’ve got 3 questions. (As I have already read in some answers before, SHA-256 is not directly performed on the message but on an array, thanks for ...
3
votes
1answer
3k views

Why do we use multiple rounds of encryption?

I understand that DES and AES use multiple rounds of encryption to secure the cipher text output, what is the real reason this is carried out? Is there a certain point performing multiple rounds ...
0
votes
1answer
863 views

How to optimise Euclidean Algorithm for large numbers? -RSA

I am using the standard version of the Euclidian Algorithm (i.e. GCD(270, 192) = GCD(192, [270 % 192]) = ...repeat until 0) to determine if two numbers are coprime. I run the algorithm, check if the ...
0
votes
1answer
225 views

Besides binary, decimal, hex, oct, are there encryption algorithms based on exotic/other numbering systems?

We all know there is Base 10, Base 16, etc. Are there encryption algorithms out there based on different or unique Base-N numbering systems?
5
votes
2answers
680 views

Why do stream ciphers like A5/1 and ZUC have “frames”?

A5/1 and (I think) ZUC, both stream ciphers used in mobile telecommunications, have "frames" where the, in addition to the key, a frame number is provided to the keystream generator which produces a ...
0
votes
1answer
107 views

Combining keys after key expansion: is it secure?

I've found an algorithm taht performs the following: expand the two keys using cryptographic hashing functions so the final keys will look like nonsense ASCII, then XOR them together to create a ...
20
votes
5answers
2k views

Are there any (asymmetric) cryptographic primitives not relying on arithmetic over prime fields and/or finite fields?

Trying to figure out if any (asymmetric) cryptographic primitives exists, which do not rely on arithmetic over a prime field and/or arithmetic over a finite field, some people might get lost in ...
2
votes
1answer
541 views

Why is RSA considered safe?

Why is RSA safe, using this algorithm to calculate $d$ as the private key? $$e\cdot d \equiv 1 \pmod{\varphi(n)},$$ where $e$ is part of the public key and $n$ is also part of the public key, so there ...
7
votes
1answer
420 views

Does a conditional statement depending on a round number introduce timing attack problems?

In a cryptographic implementation I’m playing with, there’s a round function which includes a conditional if statement. Stripping the superfluous stuff, the C ...
-2
votes
1answer
510 views

Is it possible to attack an SHA-256 hash seeded with PHP’s mt_rand function?

Is it possible to attack this construction if the attacker only knows the hash? ...
5
votes
3answers
284 views

Anti-spamming hash-based proof-of-work?

I'm planning to implement a public mailbox for receiving feedback, and I'd like to use hash-based proof-of-work to frustrate spammers. First, we want to use 320-bit capacity Gimli permutation as the ...
3
votes
1answer
4k views

HMAC-SHA256 vs HMAC-SHA512 for JWT API authentication

Which algorithm is recommended to use when encoding / decoding JWT web application tokens? Is using HMAC-SHA256 enough or would using ...
0
votes
1answer
72 views

Why can an arbitrary compression function mapping $\{0,1\}^{m+2^m} \rightarrow \{0,1\}^m$ not seriously be considered collision resistant?

I recently got a question that I’ld like to share here, since answers might be useful (or at least interesting) for people diving into Merkle-Damgård hash constructions for the first time. We know ...
1
vote
1answer
144 views

Degree of a big S-box

Assume we have a big S-box (i.e. $15*15$). We have truth table of it. (so $2^{15}$ output). How can we find its degree without using Algebraic Normal Form of its Boolean functions. Or with ANF, can ...
3
votes
2answers
663 views

AES: How to create the S-box with Sage

The $Sage$ code for the AES $S-box$ is below and a link is here: Polynomial representation of the affine part of the AES S-box. An online version of $Sage$ to test this is here. I understand most of ...
1
vote
1answer
443 views

Aes 128, CTR mode, Counter Mode, Hmac, mac

Assume Alice and Bob are communicating using 'MAC then Encrypt' paradigm. Specifically, they are using HMAC with SHA256 as the hash function and the output is truncated to 40 bits. They are using AES-...
0
votes
1answer
212 views

Is triple-CRC-32 a bad (or not) idea for generating a uniform distribution hash? [closed]

I have an input of 288 bits (comprising 4 × 32-bit and 10 × 16-bit integers). I need to hash this to 96 bits with as few collisions as possible. I'm aware that CRC is a bijective hash, thus ensuring ...
4
votes
1answer
856 views

How did someone discover N, order of G for SECP256k1?

Could someone please explain, in simple and easy terms, how the creators did (or should have) derived the N, order of G for ...
4
votes
2answers
505 views

How can we create the AES S-box using a different irreducible polynomial?

The substitution-value of input byte $\mathtt{C2}$ is $S[\mathtt{C2}]=\mathtt{2F}$. This comes from applying the Euclidean algorithm to $A(x)A^{-1}(x)\equiv 1\pmod{p(x)}$, where $A(x) = x^7+x^6+x$ (...
2
votes
1answer
188 views

How does the nonlinear function of KeeLoq work?

I want to know how the nonlinear function of KeeLoq works. Here at Wikipedia it says that: The NLFSR feedback function is 0x3A5C742E I understand that ...
0
votes
1answer
458 views

Can you help me understand Pollard's rho example?

I'm studying the Pollard's rho algorithm to solve discrete logaritms on the Handbook of applied cryptografy but I didn't understand one part of the theory and looking at the example gets me more ...
2
votes
1answer
132 views

What is gpg2 algo 1 and 8 concerning its signature-procedure?

While signing a test-file, gpg2 creates a file test.sig which contains this: ...
3
votes
1answer
146 views

Why does Salsa20 algorithm require incrementing word[8] and word[9] after producing cipher text message

I'm trying to get understanding of Salsa20 algorithm. There is an official specification from Daniel J. Bernstein at link. Everything in spec is clear and I could write an implementation on Swift. ...
-4
votes
1answer
2k views

Is AES256 the most secure encryption algorithm available at the moment? [closed]

I have had to edit this question because it was too broad (sorry didn't realise that was not allowed...), so, lets go with: Is AES256 the most secure encryption algorithm available at the moment? If ...
2
votes
1answer
78 views

How do quantum key distribution systems tolerate noise?

It seems to me that any noise in the signal would result in Alice and Bob generating different keys, without a simple way to tell the difference. How do quantum key distribution systems tolerate ...
3
votes
1answer
574 views

How are Elliptic Curve private and public keys actually used to encrypt or sign data?

I've read article after article about curve parameters, generator points, the dot operation, and how you dot the generator point priv times to get the ...
-1
votes
2answers
128 views

What is the difference between algorithm and passphrase?

If there is an algorithm securing a document, then why is there also a passphrase when the algorithm is already there? And if there is a passphrase securing a document, then why do we also use the ...
2
votes
1answer
189 views

What 'exactly' are AES dual ciphers?

I recently posted a question about AES dual ciphers based on a certain understanding of them. Now I am not so sure if my understanding is correct. AES: a question about dual ciphers and security ...
1
vote
1answer
130 views

Security of AES under modification of Sboxes and/or MDS mixing layer

Is the security of AES algorithm increased by using many s boxes at the same time instead of using only one s box , and the same question for using many MDS instead of only one.
4
votes
1answer
104 views

Proof of Disclosure? Is there such a thing?

Let's say I have a document. I want to give you a copy, and then I want to prove that I gave you a copy. Ie, I want some kind of digitally signed receipt from you. If you're dishonest, you may receive ...
1
vote
1answer
160 views

Using non-standard constants for SHA-256

For SHA-256, FIPS 180-4 states the following on the constants: These words represent the first thirty-two bits of the fractional parts of the cube roots of the first sixty-four prime numbers. If ...
2
votes
1answer
256 views

AES: a question about dual ciphers and security

I have recently learned of dual ciphers, in particular dual ciphers of AES. It seems there are many. Most of my information comes from:(1) Representations and Rijndael Descriptions. In this paper the ...
1
vote
1answer
129 views

(AES in mind) How can we show two irreducible polynomials have a bit-wise linear isomorphism

This refers to answer 2 on a similar question:Design properties of the Rijndael finite field I am unsure what many of the terms mean in this answer. I think a bit-wise linear isomorphism of ...
2
votes
0answers
188 views

If we use another irreducible polynomial for AES how can we show it is still resistant to DCA and LCA?

AES has been rigorously tested against all known attacks. However, I believe there are 30 suitable irreducible polynomials that could be used for AES. If we were to change the current irreducible poly ...
1
vote
2answers
68 views

How to transform a text into numbers in the shortest way possible? [closed]

My challenge is to transform a text into a representation of numbers 0-9. The number representation has to be as short as possible. What are the best options to achieve this? Edit: I also need to ...
0
votes
2answers
70 views

How to combine AES-CMACs

I have a primitive that is able to generate a AES-128-CMAC from a message. $\operatorname{CMAC}(\text{MessageAddress}, \text{MessageLength}) \rightarrow \text{result}$ I cannot change this primitive....
0
votes
1answer
852 views

Cryptography math requirements [closed]

I know that most of the math related to cryptography is number theory/abstract algebra/probability, but I was wondering if there are some algorithms that make use of other fields of math like real/...
41
votes
4answers
13k views

Cryptography algorithms that take longer to solve on a GPU than a CPU

I know that Graphics cards are faster at solving algorithms like SHA-256 because of the many builtin processors, but are there Algorithms that take actually longer on a Graphics card than on a modern ...
0
votes
2answers
279 views

Homomorphic Encryption Arithmetic Operations [closed]

I am looking to do arithmetic operations on encrypted values that will decrypt to be the result of the value decrypted. Does anyone know of any code examples of this in use? Usage of the equation ...
2
votes
1answer
276 views

Is there an encryption algorithm with a key that can only be used to decrypt?

I was wondering if there were any encryption algorithms that kinda worked like RSA in the sense that there are two keys, however, one of the keys only decrypts (meaning you can't encrypt with it) and ...