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

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

-2
votes
0answers
30 views

Entropy measurement from playcards [on hold]

this code brings me to despair. under "seat one" is a name and under "seat two" is a name.
3
votes
1answer
103 views

Improving efficiency of an “encryption” algorithm based on a chaotic map

I've implemented an "encryption" algorithm that uses the deterministic chaos of an extended logistic map: $x_{n+1}= r_n \cdot x_n \cdot (1-x_n)$ $y_{n+1} = \begin{cases} \text{$x_n+y_n$}...
-1
votes
0answers
26 views

Figure out the algorithm being used [closed]

I have 16 bytes: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01. Some algo take those bytes and calc an 4 bytes value 0x54 0x46 0x08 0x58. This 4 bytes uses for build a table: 0x54 0x46 0x08 ...
0
votes
1answer
42 views

Can Base64 be seen as a way of encryption if we use different index table?

As we know, the index table (which maps bytes in [0, 63] to characters) of Base64 encoding is public, so everyone can decode Base64 strings from others. But what if we use a shuffled index table and ...
-2
votes
1answer
62 views

How could I test my own Cipher? [closed]

I recently developed a new cryptographic algorithm. I just initiated with just nothing in mind. But being near to completion (though my algorithm is constantly developing. Now it is version 11.02), I ...
-2
votes
4answers
101 views

Size of A Hashed String Using SHA-512

When hashing a messages of size of n, does the SHA2 algorithm always produce the same sized hashed value? The reason I am asking is that I am building an OAuth 2.0 ...
0
votes
1answer
52 views

Question about brute force running time

Quite a simple question though I can't wrap my head around it: The key size is: $n$ Because it's brute force it tries each possible key once from $0$ to $n$, but in my head that just makes the run ...
2
votes
0answers
39 views

Reduction from integer factoring to computational Diffie Hellman

The computational Diffie Hellman (CDH) problem for ${\mathbb{Z}}^*_p$ is given a prime $p$, a generator $g$ of ${\mathbb{Z}}^*_p$, and a pair $(g^i, g^j)$ to compute $g^{ij}$. The value $g$ is called ...
2
votes
2answers
166 views

Does there exist a CSPRNG that does not require generating prime numbers, but also does not depend on any other cryptographic primitives?

The following excerpt is taken from the “Cryptographically secure pseudorandom number generator” article on Wikipedia: CSPRNG designs are divided into three classes: those based on ...
2
votes
2answers
104 views

Cryptography scheme to prove you really are the author for something

Say I'm a researcher like Satoshi Nakamoto that wants to stay anonymous. I want to publish documents and sign them somehow. A few years, I want to reveal my identity and prove it was me who was ...
3
votes
1answer
58 views

Could we use a more efficient hash for signature generation?

Is it possible to use a more efficient hash - such as one based on GHASH - instead of a cryptographic hash for signature generation? In other words, could a combination of a fast hash and the private ...
2
votes
2answers
73 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: ...
3
votes
3answers
235 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
32 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
97 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 ...
3
votes
1answer
75 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
72 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
35 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
184 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
206 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
0answers
115 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 ...
3
votes
2answers
193 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
63 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
89 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
30 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
50 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
50 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
103 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
392 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
64 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
66 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
68 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
142 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
114 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
90 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
568 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
64 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
81 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
112 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
126 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
184 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
304 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
59 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
101 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
156 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
167 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 ...