Questions tagged [implementation]

Implementing a cipher or protocol is the process of taking it from its mathematical or algorithmic description and producing a working version, often in computer software or hardware. This tag should be used for any question discussing the various potential considerations and pitfalls of this process, for example padding.

Filter by
Sorted by
Tagged with
2
votes
1answer
42 views

Compact ROM with space only for EdDSA. How to fit a key exchange algorithm inside?

I have implemented Ed25519 for a constrained-memory system, and I want to provide a Shared Secret functionality. The recommended method is to use X25519 for this; but then I would have to implement ...
5
votes
2answers
168 views

Fast cryptographic hash function for short inputs

I am looking for a cryptographic hash function optimized for speed on short inputs, in order to implement a pseudorandom generator with expansion factor 2 (e.g. takes 16 bytes of input and outputs 32 ...
4
votes
1answer
81 views

How does Montgomery reduction work?

I want to reduce a multi-precision integer $x$ modulo a prime $p$, very fast. Performing the traditional Euclidean division for only calculating the modulo, is inefficient and modular reduction is at ...
3
votes
1answer
283 views

Implementing Standardized AES Algorithm

-- Hopefully this question fits here -- Time and time again, there is always one person who asked about creating their own encryption standard/cipher, and we all agree to stop them early on because we ...
2
votes
0answers
46 views

Is “double-and-add-always” a good mitigation against side channel attacks?

In Discrete Log based Cryptography, one of the core operations that one, has to perform is modulo exponentiation. There are many algorithms to choose from, especially, when considering my point of ...
2
votes
1answer
106 views

How to check that an $km \times km$ block-binary matrix is an MDS matrix in $k$-bit words over $\operatorname{GF}(2)$

I have been reading about MDS matrices. It is defined as (paraphrased from Section 2.1) An $n \times n$ matrix $M$ is MDS if and only if $bn(M) = n + 1$ where $bn$ (branch number) is defined as: $bn(...
0
votes
1answer
25 views

Implementation of a decryption mixnet, and problems with the size of the key

I've been studying decryption mixnets, in the context of e-voting and stealth networks. Let's describe it in a very simplified way. The concept is pretty simple. A message M is forwarded through ...
2
votes
1answer
56 views

Pipelined architecture for secret key block ciphers

I want to implement a pipelined architecture of AES128; and I couldn't figure out the number of the pipline stages. As I undestand, it is possible to make the piepline stages inside the round, or ...
1
vote
2answers
77 views

What is the proper way to implement AES CTR with 128 bit nonce and 64 bit counter?

While encrypting AES in CTR mode, the input to the AES encryption function is the either a combination of IV + $m$ bit counter or is either $0$ IV bits with an $m$ bit counter. It is however rare to ...
1
vote
2answers
103 views

Hessian Curve Implementation

I tried implementing the Hessian form of an Elliptic curve over the prime field Fp where, p I have taken as 1051. The curve equation I took is $X^3 + Y^3 + cZ^3 = dXYZ$ with c = 1 and d = 6. Selected (...
0
votes
1answer
68 views

Exponentiation Problem of G2 in MNT curve

I made a simple python program in the Charm framework (https://github.com/JHUISI/charm): ...
0
votes
0answers
20 views

How to find the output shares of first-order threshold implementation of cubic degree function?

Assume $d=abc$ and to implement first order threshold implementation , the minimum input and output shares are 4 (1*3+1) , and 4 , calculated using ${4\choose 3}$ , Theorem 2. The new TI ...
7
votes
0answers
153 views

How to implement arbitrary s-box in a side-channel-free way in C?

This could be a question for CodeReview.SE, but I thought it might require non-trivial cryptographic knowledge to merit it on-topic here. The C language is chosen as it's a common language for ...
1
vote
0answers
41 views

How vulnerable are SIMD operations to side channel attacks?

For a while, I was experimenting with optimization of several crypto implementations with SIMD (Single Instruction Multiple Data ) made available by C compiler ...
1
vote
0answers
30 views

Understanding a method of vector multiplication

Recently, I attempted to implement the HQC Post-Quantum KEM in (almost) pure python. In the scheme specification whitepaper, it states the following: Here is a simplified version of the function I ...
0
votes
0answers
30 views

How Should Form Input be Encrypted for sending to a Server?

I apologise if this question is a duplicate. I couldn't find any similar questions. I am writing a web app that consists of a series of drop-down style question menus. These generate more drop-downs ...
6
votes
1answer
146 views

How does this POLYVAL modular reduction algorithm work?

I recently found the GitHub repository used to make the measurements in the AES-GCM-SIV paper where they implement polynomial hashing using POLYVAL. This means in this context to compute the usual $\...
4
votes
0answers
98 views

How are the constants found in the AVX2 implementation of CRYSTALS-KYBER round 2 generated?

The post-quantum lattice-based cryptosystem CRYSTALS-KYBER which has made it to the second round of NIST PQC includes two implementations: 1) a baseline reference implementation in C and 2) an ...
0
votes
2answers
112 views

Implementing BFV Relinearization

I'm currently working on a Python implementation of the BFV[12] cryptosystem. I got to a point where key generation, encryption, addition and decryption works as expected. Where I'm struggling with ...
0
votes
0answers
47 views

AES. Algorithm of multipication in finite field [duplicate]

I multiply 2 numbers using their polynomial representation and addition via XOR. Do I need to find the remainder of the division by $x ^ 8 + x ^ 4 + x ^ 3 + x + 1$, using the operator "%" or by ...
0
votes
1answer
108 views

Zk-Snarks vs Homomorphic Encryption

I have been reading a bit about encryption algorithms. I have come across these two algorithms.My use case is the ability to work with encrypted data and my data will be string data. I see that ...
0
votes
1answer
86 views

How is a block-chain stored?

Background of the problem: I am undertaking a blockchain course at University and I have taken up a case study for blockchain that relates to logistics. The requirements are simple, yet I am confused ...
1
vote
0answers
38 views

Symmetric proxy re-encryption practical implementations

I want to encrypt some files in a cloud and delegate decryption rights to authorized users. The performance matters for me and I think I should use schemes utilizing symmetric encryption. Could ...
2
votes
2answers
57 views

Proper method of writing pseudo random sequences into binary files?

I am working in Python and created a B.B.S. implementation that outputs a sequence of pseudo random positive integers into a Python list. I would like to write this data to a binary file and pass it ...
1
vote
1answer
154 views

80-bit security and attack time

Many designer claimed that their cryptography scheme has 80-bit security. So how to calculate the time of attcking this 80-bit security cryptography scheme, such as 80-bit security RSA using a kind of ...
0
votes
1answer
35 views

running time measured by clock cycle

Some literature said the running time of attack algorithm is measured by clock cycles. What is the meaning of clock cycle and why the running time of attack algorithm is measured by clock cycles?
2
votes
2answers
241 views

Fully homomorphic encryption (over addition and multiplication) library in python

I was wondering if there is a commonly used library in Python (or another common language such as Java, C++, etc.) for fully homomorphic encryption over multiplication and addition that also supports ...
3
votes
1answer
217 views

A possible error in the book

So I have been reading this book called "Implementing SSL/TLS using Cryptography and PKI" While going through it, this snippet of code got me baffled ...
1
vote
0answers
84 views

Why are integers considered “little endian” in ChaCha20 function?

Why the ChaCha20 - IETF algorithm that generates 512 bit keystream per 32 bit counter (that gets incremented), considers "the input words" that form the internal state as little endian ? What will ...
3
votes
0answers
95 views

How do byte-sliced AES implementations work?

While I understand the principle of bit-slicing, several papers mention byte-sliced AES implementations (see e.g. Homomorphic Evaluation of the AES Circuit and Fast Implementations of AES on Various ...
0
votes
0answers
13 views

Symmetric keys for media attachments in pairwise group messaging

One way of implementing end-to-end encrypted group chats is simply to consider it as a collection of pairwise channels. For example, in a group of Alice, Bob, and Charlie, Alice will send a message by ...
1
vote
2answers
84 views

Secure implementation of public key cryptography

Reading online I've found out that for example the RSA implementation that you usually find on textook is not secure. Where I can find some secure implementation of algorithm such as RSA, ECDH, ECDSA? ...
1
vote
1answer
65 views

How should one handle the identity value and other “obviously” weak secret random values?

In RSA, ECDSA, ElGamal and quite a few other schemes, using a secret (random) value equal to 1 might not provide any form of security, while still being mathematically sound. For RSA, ECDSA or ...
0
votes
0answers
35 views

The implementation of Lattice-based HIBE

There are many lattice-based scheme papers adopt the lattice basis delegate technical from Agrawal et al. But I can't find the relevant implementation on the Internet since 2010. In fact, I almost ...
1
vote
1answer
67 views

A bit-sliced implementation (or the algebraic normal form) of the two FIDES S-Boxes

I want to see a bit-sliced implementation of 5-bit and 6-bit S-Boxes of FIDES or, at least, a representation of these two functions in algebraic normal form. Where can I find it?
1
vote
0answers
57 views

Ressources for implementing cryptography [closed]

I am looking for resources on how to implement cryptographic algorithms. I am a cryptographic researcher, so I am not interested in reviewing the basics, and I don't need the talk about it not being ...
0
votes
1answer
160 views

How to represent the point-at-infinity(Elliptic Curves) in code? [duplicate]

I am writing code for Elliptic Curve Cryptography. I have a class class EllipticCurvePoint. ...
1
vote
1answer
152 views

SHA3-512 troubleshooting - is there a worked example for hashing the “zero-length string”?

(I wondered if this question should be asked on StackOverflow instead because it's a programming related issue, but it's bound to the intricacies of SHA3, which I figured was a better fit for Crypto....
0
votes
1answer
50 views

Reference books in security and privacy preservation [closed]

I am looking for books or reference guides to learn and teach "cryptography, security and privacy preservation techniques"? I need some advice to good resources that I can use.
0
votes
1answer
73 views

How to interpret a specific mathematical notation in “FIPS 202” (SHA-3 / Keccak)

tl;dr What does "d <= |Z|" mean in the context of bit array manipulations? As a learning exercise I'm working on an implementation of SHA-3. I am not a cryptography specialist in any way but I ...
1
vote
1answer
63 views

Why algorithmic symmetry is important in hardware implementation?

In AES, the encryption and decryption functions ordered in a symmetric way, I mean the same order of functions are used inside the round structure of both encryption and decryption (subbytes, ...
0
votes
1answer
157 views

How to implement GSW13 using Helib or SEAL?

I want to implement the homomorphic encryption scheme proposed in GSW13, and make some changes to it, but seems that there is no library that has already been implemented it. Since this is a ...
2
votes
2answers
166 views

Efficient way of generating a random number of N (less than 64) bits with exactly M bits equal to one [closed]

Would there be an efficient way to implement a function with the following signature: unsigned long long int random_word(size_t n, size_t m) that would generate ...
1
vote
1answer
71 views

Lookup table for DSA/ECDSA/Schnorr multiplication

Something in common to [EC]DSA and related signature schemes like Schnorr is that the most expensive part of signing is calculating $r = g^k$ in the group for some per-signature $k$ of length $b$ bits....
2
votes
1answer
59 views

Serpent intermediate rounds differs from example code, but result is still correct, is it a problem?

Through great pain and suffering, I've been able to successfully implement Serpent. For example, when using the key 00112233445566778899aabbccddeeff, and encrypting ...
4
votes
3answers
1k views

Is the curve25519 algorithm a special(implementation) one of ECDH?

It's the first time for me to learn about Key Exchange Protocol. And I thought that in both ECDH and DH there is a necessary step to share some public infomation(the common parameters) to each sides ...
2
votes
3answers
207 views

Are XOFs and KDFs more usable than DRBGs?

CSPRNGs have 2 design requirements: output unpredictability, back-tracing resistance. In addition to which, NIST SP 800-90Ar1 added other features such as a) instance customization/personalization,...
4
votes
1answer
641 views

Generating a random point on an elliptic curve over a finite field

I have coded an implementation of elliptic curves in order to apply some of the ECC algorithms. However, in most of them, Alice needs to choose a point P on a given curve. What is the general ...
1
vote
1answer
110 views

Application of MDS matrices in serial and round-based implementations

We know that MDS matrices are used in the diffusion layers of block ciphers. My question: what types of MDS matrices can be applied to serial or round-based implementations or both of them? I ...
2
votes
2answers
203 views

Why should one model an entropy source in order to build a TRNG?

Some assert that a theoretical model of the unconditioned source must be created when building any TRNG. It's believed to be a fundamental requirement. So a few related questions arise:- What is a "...

1
2 3 4 5
9