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
0
votes
1answer
46 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
63 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
80 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
28 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
54 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
116 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
25 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
117 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 ...
2
votes
1answer
212 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
66 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 ...
2
votes
0answers
63 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
11 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
78 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
60 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
32 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
58 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
98 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
105 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
46 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
71 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
62 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
0answers
47 views

Implementation of addition in the scheme TFHE

I want to implement the addition operation in a fully homomorphic scheme - TFHE. It contains homomorphic operations on bits: AND, OR, NOT, XOR. Found addition algorithms include left and right shift. ...
0
votes
1answer
137 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
160 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
65 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
57 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 ...
3
votes
3answers
972 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
190 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,...
1
vote
1answer
491 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
103 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
195 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 "...
47
votes
2answers
6k views

How is the Swiss post e-voting system supposed to work, and how was it wrong?

I read that the Swiss post had an e-voting solution developed, made it possible to obtain the source code for review, and that vulnerabilities were found. Apparently we are not talking about the ...
5
votes
1answer
198 views

How would we design a fast circuit to solve LCS35?

LCS35 is a time-lock puzzle, stated in Ronald L. Rivest's Description of the LCS35 Time Capsule Crypto-Puzzle [1] (April 1999). That instantiates a system in Ronald L. Rivest, Adi Shamir and David A. ...
1
vote
0answers
96 views

Efficient polynomial ring multiplication with coefficients in GF(2^s)

Is there something similar (or an other efficient approach) to the NTT for the multiplication of polynomials in polynomial rings modulo $X^{2^n} + 1$ with coefficients in $\operatorname{GF}(p)$ with $...
1
vote
1answer
97 views

Implement Google Adiantum else where?

Google made the headlines with its new Adiantum encryption method, and i read (TechCrunch) that: In the meantime don’t expect any instant gains, but future low-power devices may offer better ...
6
votes
1answer
185 views

Does a masked look-up table prevent cache timing attacks?

When applying the boolean masking countermeasure to a cipher which uses an S-box $S$, a way to handle this nonlinear operation is to recompute a new S-box $S'$ such that $S'(x \oplus r_{in}) = S(x) \...
0
votes
0answers
49 views

Proxy decrypt algorithm in Extended Proxy-Assisted Attribute Based Encryption (ABE) Scheme

Context I'm trying to implement the Attribute-Based Encryption (ABE) scheme described in the paper - Extended Proxy-Assisted Approach: Achieving Revocable Fine-Grained Encryption of Cloud Data (Yang ...
0
votes
1answer
61 views

Starting stream cypher, first block (Salsa20)

I'm implementing Salsa20 in Rust for fun. I have the initial state (4x4 32-bit matrix) setup from the key, nonce, and stream position 0. I'm using the Wikipedia Salsa20 article as reference, and I'm ...
1
vote
1answer
94 views

Reducing the XOR's in Implementation Cost

Suppose that we want to implement the following equations in binary finite field. $$ \begin{array}{l}\tag{1} y_{{1}}=x_{{1}}\oplus x_{{2}}\oplus x_{{7}}\oplus x_{{8}},\\ y_{{2}}=x_{{1}}\oplus x_{{2}}\...
1
vote
0answers
98 views

Burmester Desmedt confused on the last step

I try to implement in code the traditional burmester desmedt algorithm for group key agreement: But I have the following question regarding the last step: $K=k_{i-1}^{nx_i}K_i^{n-1}K_i+1^{n-2}\dots ...
1
vote
0answers
78 views

Could you design something like a ring signature that uses website accounts instead of keys?

Ring signatures allow one to prove that you own a private key corresponding to a public key from a set of keys, without revealing which private key you control. This is useful if you are part of some ...
4
votes
1answer
113 views

Magic Number to calculate number of rounds for M-R in FIPS 186-4

In Fips 186-4, there is an algorithm in Appendix F (at page 117 in my copy of the 2013 version) to calculate the number of rounds of the Miller-Rabin primality test to random bases. Does anybody ...
1
vote
2answers
110 views

Implementations of GCM with 64-bit cipher

The paper The Galois/Counter Mode of Operation (GCM) describes mainly the 128-bit case, for use with 128-bit block ciphers such as AES. AES-GCM test vectors are available from NIST. The paper also ...
3
votes
2answers
351 views

Implementing randomness extractors

A randomness extractor is a function that takes an input sampled from high entropy distribution and outputs a value that is close to uniform distribution. It is slightly different from a PRG. PRGs ...
13
votes
1answer
244 views

WOTS+: Why does it XOR before running data through the hash function?

I'm implementing WOTS+ in a new language and I can't seem to wrap my head around the fact that WOTS+ XOR's their input with its mask right before hashing it. I tried to look for any reasoning but so ...
2
votes
1answer
499 views

ECDSA with common nonce?

I'm new to cryptography, and I've searching about ECDSA because I'm trying to solve a CTF. I've already check this site and Google, and I think I'm in the right path, but probably I am missing ...
3
votes
1answer
362 views

Choosing good entropy $g$ and $p$ for a classic Diffie-Hellman Key exchange

When selecting $g$ and $p$ for the Diffie-Hellman modular exponentiation: $ s= g^x \bmod p $ Which pairs of $g$ and $p$ are considered good nowadays, are recommended by bibliography? What I try ...
1
vote
1answer
114 views

Can I use NaCl's scalar multiplication functions for Diffie Hellman Key Agreement?

I want to create some software that performs diffie hellman group key agreement but I don't want to reinvent the wheel even if I know how it's done. So I came accross the NaCl library, especially the <...

1
2 3 4 5
9