Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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 ...

-1
votes
0answers
19 views

Implementation of EVP AES 128 CTR using openssl library

How should I provide counter value in order to test my algorithm with the standard test vectors given in IETF Tools? Code snippet: ...
0
votes
1answer
21 views

Location of header fields within a OpenPGP message

I'm trying to understand the structure of a OpenPGP message in detail. Therefore I generated a test message and parsed it using gpg --list-packets. The output is ...
2
votes
2answers
71 views

Is there a way to sign a message without being allowed to see it?

I want to sign a message while not being able to see the message. Logically, there should be a way, I just don't know how this translates into cryptography. Here is an illustration for what I mean: ...
4
votes
3answers
205 views

Is it possible to exactly reverse engineer an unknown cipher inside a black box?

Consider the following arrangement:- There is an unknown cipher algorithm operating inside the black box. You can enter infinite key /plain text pairs, and observe all of the outputs. The box might ...
0
votes
1answer
30 views

Secure offline treasure hunt

Say I would like to create an app that would allow users to organize treasure hunts for their parties. The host of the party would create a list of GPS coordinates for each hiding spot and distribute ...
0
votes
1answer
63 views

How many rounds of encryption is ideal?

I am a newbie to the cryptography world. I am working on a custom algorithm that encrypts the data multiple times and results in a cipher text. It uses a different key in each round to encrypt it. I ...
0
votes
0answers
15 views

Are the cryptographic primitives of ZKPs more closely related to an encryption scheme or to a DSA?

I've read about how the Fiat-Shamir heuristic has been used to construct Non-Interactive Zero Knowledge Proof systems, Schnorr signatures, and encryption schemes. From my understanding, the ...
3
votes
1answer
67 views

Can length extension attacks be avoided by a single bit flip?

It always seemed to me that length extensions are possible simply because no special operation is performed after the last operation - for instance in a Merkle-Damgård construction. Basically the MD ...
1
vote
2answers
63 views

Encrypting current time using 3DES as a signature

I came across a peculiar system for generating "signatures" ("signatures" is within quotes because this is a bad use of 3DES) in the wild. It works as follows: a symmetric key is generated and used ...
2
votes
0answers
33 views

Can we encrypt data that must be decrypted with any private key plus a server generate bits?

I have come up with a scenario to make a secure data. Suppose I have a public encrypted file that anybody can download. But whenever anyone want to decrypt that data they need to get a key from server ...
3
votes
2answers
178 views

Is this algorithm good enough for small radio messages?

This question is related to: How to implement security - authenticity/confidentiality/integrity for 6/14 bits radio messages? I am looking for a message that an attacker listening to the radio ...
5
votes
3answers
176 views

Where can I find the description of SHA0 algorithm?

Where may I find the description and or pseudocode for the SHA0 algorithm. I am looking for something on these lines - HMAC RIPEMD. I have been implementing a few of those (HMAC, HOTP, TOTP and MD4, ...
2
votes
1answer
106 views

How few cryptographic primitives can we use to derive all other constructions?

We have a lot of cryptographic primitives now, and many methods of deriving one type of scheme from another. There are even some like the Merkle signature scheme, which uses a hash function to derive ...
4
votes
2answers
150 views

understanding the block bits for DES

I'm trying to understand cryptographic protocols, and I've started with the DES algorithm. DES specs: it uses 64 bits for the plaintext, 56 bits for the key, with a result of the same 64 bits of ...
2
votes
2answers
54 views

rotor machines: secrecy of wiring

During the heydays of rotor machines, the internal rotor wiring was always a closely guarded secret. Even fully cleared repair staff was not allowed to do anything that could reveal it. As the ...
1
vote
2answers
82 views

Public-private algorithm where it is not possible to recover public key from private key?

Is there an asymmetric algorithm where it is not possible to extract a public key from private key? So far any algorithms I tried (dsa, rsa, ecdsa, ed25519) successfully recover their public keys from ...
2
votes
1answer
27 views

Optimized Garbled Circuit Algorithmic Description

Till 2018, Garbled Circuit (GC) is of its age 30's and many optimization methodologies have been proposed, including point-and-permute, row-reduction, free-xor, fixedkey-blockcipher, half-and. But, ...
0
votes
1answer
47 views

Cryptographic algorithm for knowing who has more money?

I recall reading about this but forgot what it’s called. Suppose two people want to know who is richer but don’t want to reveal their net worth to the other. How can they securely exchange info to ...
0
votes
1answer
45 views

Reference for the Tortoise and Hare algorithm by Floyd?

Can someone please point me to a book or paper that describes the Tortoise and Hare algorithm by Floyd? I know there are ample websites out there, but for reference purposes, I need a book or paper ...
2
votes
0answers
74 views

Fastest known Elliptic Curve Cryptography “solution” (coordinate systems (multiple?), algorithms, precomputed values etc)?

I am writing an Elliptic Curve Cryptography SDK in pure Swift, and currently I am only using Affine Point and simple Double-and-add. I am soon about to work on a faster solution. I am asking for help ...
8
votes
2answers
383 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
60 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.
0
votes
0answers
62 views

Is this modification of the sponge function cryptographically weaker than the standard sponge function?

Let $\lfloor A \rfloor_B$ denote the first $B$ bits of a bitstring $A$. Let $F$ denote the underlying function of the sponge construction (for SHA-3, $F = \text{Keccak-}f[1600]$ ), assuming that ...
0
votes
0answers
64 views

NIST Elliptic Curve Algorithm

I am wondering which algorithms are used to compute ec_mult and ec_twin_mult in the following implementation guidance document. ...
4
votes
1answer
103 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
67 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
67 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
85 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 ...
1
vote
4answers
371 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
59 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
80 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
107 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
99 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 ...
3
votes
1answer
136 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 ...
1
vote
2answers
240 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
57 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
71 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
97 views

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

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
145 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
141 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
132 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
152 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
65 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
61 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
107 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
282 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
90 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 ...
0
votes
0answers
86 views

Finding key algorithm based on a lot of seed-key pairs

I have a question on finding algorithm on seed-key pairs. I have finite data set of seed-key pairs (at this moment about 30000 proper seed-key pairs). Seeds and keys are 16bit (so I have 65536 ...