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
9
votes
2answers
450 views

Which attacks are prevented by the different initial hash values for SHA-2 with truncated output?

NIST specified SHA-2 hash functions with truncated output. Those hashes use different initialization values than SHA-256 or SHA-512. SHA-224 is based on SHA-256. SHA-384, SHA-512/224 and SHA-512/256 ...
1
vote
1answer
95 views

Are MD5 possibilities really $2^{128}$? [duplicate]

I have a simple question: Are we certain that the md5 hashing algorithm can produce $2^{128}$ different outputs ? If so, how ? Note: Sorry if this has already been asked, I really couldn't find it.
4
votes
1answer
277 views

I have this list of LibSodium primitives, which should I pick so that the implementations tend to be interoperable?

When I integrate lib sodium, into a c# project, and try to consume, encryption and decryption in a particular way, it works, but the confusion is about, which method to use while encryption or ...
1
vote
1answer
163 views

What is an example of elgamal homomorphic double encryption?

I am looking for such an cipher algorithm that is based on assymetric cryptography where the order of encrypting is irrelevant. For example: There is a message "x", Bob encrypt that message with his ...
0
votes
2answers
74 views

How does authentication work differently between asymmetric and symmetric cryptography?

Must Bob and Alice establish a 'connection' before a symmetric or asymmetric encryption scheme is secure? If so, is there ever some expected plaintext whose decryption authenticates the users? In ...
17
votes
3answers
4k views

Is it possible for a cryptographic algorithm to limit the number of times a package/ciphertext can be decrypted?

I got the idea from Eve Online's BPCs (Blueprint Copy). The in-game explanation is that the license to manufacture a copy of a starship is limited to X times, and afterwards the BPC is automatically ...
3
votes
2answers
192 views

Figure out algorithm to numeric key generator with one known input and output

I have a software program running on a piece of hardware. To access a specific functionality it runs a challenge-response-like authentication, that is it generates a numerical 4-digit PIN and expects ...
2
votes
4answers
3k views

Can SHA or MD5 results be decrypted?

I have learned that SHA-1 and MD5 are one way hash functions, which means that it is not possible to obtain the original value by performing the reverse calculation. There however some online ...
-1
votes
1answer
98 views

Encrypt 2 numbers preserving arithmetic correlation

I want to encrypt 2 numbers using a public key and have the reader know the correlation between those 2 numbers. I can also share the public key. Example: ...
2
votes
1answer
97 views

Security of expanded key

Can somebody analyze this scheme and explain how (in?)secure it is? Assume that: The keys were initially securely exchanged All keys are truly random In this scheme: The key size is of length <...
4
votes
1answer
129 views

How many primitive cryptography operations are there? [closed]

Every cipher I've encountered seems to be built from slight variations of only three basic operations: the S-box, the P-box, and the XOR. I’m just wondering, are there any others? And if there aren'...
4
votes
0answers
242 views

Encrypt using ECDH with two different EC public keys, minimizing payload size

Let's say Alice has the private EC keys $a$ and $b$, with a base point of prime order $G$. Alice computes the corresponding public keys $A = aG$ and $B = bG$, and sends them to Bob. Bob now wants to ...
4
votes
1answer
538 views

Proving one time pad is perfectly secret

I'm reading about one-time pad in "Introduction to Modern Cryptography" by Katz and Lindell. I can understand the definition of perfect secrecy. However, how is OTP proven to be perfectly secure ? I'm ...
3
votes
2answers
731 views

Rolling your own crypto

I know this is usually frowned upon, but supposing you were to roll your own encryption cipher (completely on your own or with a small group of friends, with no peer review possible), what could you ...
0
votes
1answer
72 views

Identify Keccak Algorithm

I need to analyse a binary code and check if Keccak is used in this code. I can identify AES, by using Rijndael S-box. Is there a similiar box for Keccak?
-1
votes
2answers
73 views

Suggest me an algorithm design with these features [closed]

I want an algorithm design that works with galois theory and rings of polynomials on finite fields. Can someone suggest me a design that works with these concepts?
1
vote
1answer
145 views

Calculating the number of rounds required for block cipher with known differential [closed]

Suppose we have a 128-bit block cipher for which the best two-round differential holds with probability $p = 2^7$. Suppose as well that this differential is iterative and that the best differential ...
5
votes
1answer
181 views

What is the collision resistance of a 2048-bit hash based on SHA-3?

Let $M$ denote the message. Let $B_i$ denote eight different bitstrings (chosen arbitrarily or randomly) such that $$0 \le \text{length}(B_i) \le 12345678.$$ Consider the following function (it ...
1
vote
0answers
311 views

Additive homomorphic secret sharing

I am new to cryptography esp, homomorphic encryption. I would like to know if the following is possible using something similiar to additive homomorphic secret sharing. Please apologize me if its too ...
-1
votes
1answer
44 views
-1
votes
1answer
337 views

How are multiple iterations of SHA-256 handled for longer inputs?

I wrote a python program to perform the SHA-256 function. It works just fine until I try to hash longer strings. If I hash (in HEX) ...
6
votes
1answer
398 views

Is there a way one can combine two correlated hash outputs to maximize the collision resistance?

While practically diving into collision resistance, I am trying to first write a non-cryptographic hash (to learn from it) which is limited to arithmetic operations on 32-bit integers only. It ...
0
votes
1answer
76 views

Is a new block cipher harder to design than a new hash?

I realise that cipher and hash primitives are somewhat different. But they share common requirements like attack resistance amongst others. And I realise that attacks /vulnerabilities are ...
3
votes
1answer
78 views

Security implications of slow-by-design hashes on relative security vs. hash size

Would it be true to say that that one can get away with much smaller cryptographic hashes if the hashing algorithm is slow and expensive by design? Example: let's say you want 128-bit hashes. This is ...
0
votes
2answers
272 views

Keyed reversible hash function?

Is there such thing as a keyed reversible hash function? This would be a hash function where computing H(x) is easy and requires no key, but computing x from H(x) is only feasible with the key. Is ...
3
votes
2answers
300 views

Is there an encryption algorithm that only adds minimal (if any) size compared to the size of the unencrypted data?

We are working on a project in which we will need to encode and encrypt 1 - 1.3 kb worth of data at a time. We need the result of each piece of data to be the same size it was before, or be smaller, ...
-1
votes
1answer
94 views

Would flipping arbitrary bits of the ciphertext make it more secure?

Suppose I wanted to upload a text file to a malicious cloud storage provider. Would the file be more secure against decryption if AFTER encrypting it (say with the AES scheme), I flipped certain bits ...
9
votes
1answer
544 views

Understanding the wide trail design strategy

I am trying to understand the wide trail design strategy. I have read the paper (paywall-free preprint) which describes it from the point of view of AES. From what I understand, it is a technique to ...
11
votes
2answers
2k views

Why does Signal repeatedly hash the secure passphrase?

Background: I'm working on creating a small program to extract my messages from Signal's newly-added (beta) encrypted backup feature. In the Signal codebase for their Android app, I noticed that ...
2
votes
3answers
395 views

Does the DES s-box only provide confusion, or does it also provide an avalanche effect?

In DES, does the s-box provide an avalanche effect or does it only provide confusion in the ciphertext?
0
votes
3answers
283 views

Why don't block ciphers consist of a simple XOR operation with key like Stream ciphers?

If the construction of stream ciphers is already secure why does the construction of block cipher involve pseudo permutations and complex operations that makes block ciphers less faster? Is a ...
0
votes
1answer
48 views

Convert a state-dependent hash-based signature scheme into a stateless message-dependent one

Suppose we have an XMSSMT instance that is capable of signing up to 2^60 messages securely when given some state-dependent information, I could envision making it stateless as follow: Hash the ...
2
votes
4answers
243 views

How can non-nothing-up-my-sleeve numbers be used to exploit an algorithm?

I was watching Computerphile's "Magic 'Nothing Up My Sleeve' Numbers" video where Dr. Mike Pound reasons that the numbers used to create cryptographic functions should not arouse suspicion or contain ...
12
votes
2answers
4k views

Why is SHA-3 a Sponge function?

A sponge function is supposed to be able to generate an arbitrary length of output. Yet, SHA3 (Bouncycastle) constrains me to choose an output length between 224, 256, 384, and 512. Evidently, these ...
1
vote
1answer
48 views

Algorithm design to verify an assertion on encrypted values

I'm trying to design some kind of protocol but I'm stuck, need some help please.. Given $ (a,b,c)\in \mathbb{N}^+$ with $ a + b = c $ I need to send an asymmetric encrypted version of a,b and c ...
1
vote
1answer
411 views

Matyas–Meyer–Oseas for super-fast single-block hash function

Is it basically safe and correct to use the Matyas–Meyer–Oseas construction to turn a fast block cipher like AES into a really fast single block hash function? By single block hash function I mean ...
8
votes
1answer
411 views

Can a Feistel network have more than two halves, widening the block width?

Just to help form this question, this is a Feistel network:- To me this looks like:- Why does the generic architecture have to have two halves? We already have asymmetry in some variants. As I ...
4
votes
2answers
146 views

Building large S-Boxes from smaller ones

I would like to make an exhaustive list of all relevant techniques that have been studied in order to build a large S-Box from smaller ones. As far as I known, three structures are usually preferred: ...
7
votes
5answers
1k views

Calculation-Intensive Decryption

I'm looking for an encryption scheme that has the following properties: Decryption is CPU intensive, so decrypting an encrypted text may take some time (relatively, of course). Preferably, encryption ...
1
vote
0answers
154 views

Is a hash function based on multiple nested iterations of HMAC-SHA-256 cryptographically weaker than SHA-512?

Let $M$ denote a message. Choose (arbitrarily or randomly) five different sequences of bits (their lengths are allowed to be arbitrary, assuming that our HMAC construction will not exceed the ...
0
votes
1answer
120 views

How to solve rubix-cube like symmetric encryption

So for a project at University I wrote a symmetric encryption system that was very similar to how a rubix cube would work. I had each byte of my data mapped to a element in a grid, with 6 grids in ...
1
vote
2answers
65 views

What is the difference between a dual cipher and a tweak?

I have looked at the idea of dual ciphers but I cannot convince myself I really understand them. I think I just need a very simple worked example. I was given the definition: Two ciphers $E$ and $E′$...
4
votes
0answers
80 views

Is it safe to extend the length of Blake2b’s keyed hash key?

Blake2b keyed hash variation specifies a maximum key length equal to the digest size. It implements this feature simply concatenating the zero-padded key to a boundary of the block size with the ...
0
votes
2answers
402 views

Algorithm to generate ECDSA keys with random number generator

I have a certified random number generator (TRNG, it does not matter what it is for the question). I would like to use it as a source to generate secp384r1 ECDSA keys. What is the algorithm I should ...
14
votes
2answers
22k views

Do identical strings always have the same SHA-256 value?

If you hash a string using SHA-256 on your computer, and I hash the same string using SHA-256 on my computer, will we generate the same value? Does the algorithm depend on a seed (so we'd both need ...
1
vote
2answers
1k views

Can I obtain the hashing algorithm if I know both the input and the output?

Suppose I have a string "Hello World". And I pass it through an unknown function which gives output as "6Xbhkfo520/78". So, ...
2
votes
1answer
107 views

What is the difference in exchanging the Enigma rotors in their slots?

I have a question regarding the exchange of the rotors in a enigma machine. I know that there are 3 slots and that up to 8 rotors can be used in those slots. What I don't understand is, as all the ...
2
votes
2answers
348 views

Can we modify any hash function like SHA-1 or MD5 to perform multiple iterations at once to gain calculation speed?

Is it mathematically possible to adapt a given hash function (f.e. SHA-1 or MD5) so it performs a known number of iterations at once? Concrete example would be: ...
4
votes
0answers
986 views

What happens if a Sha 256 input is too long? [duplicate]

Doesn't SHA-256 only take up to 512 bits for the input block? What happens if the input is really long?
1
vote
2answers
739 views

How can a stream cipher encrypt one bit at a time and still be secure?

I was reading the differences between stream ciphers and block ciphers, noticing that block ciphers, encrypted blocks of 64 bits or so at a time. But, stream ciphers encrypt 1 bit at a time, and to me ...