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.

50 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
159 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 ...
6
votes
1answer
150 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 $\...
5
votes
0answers
224 views

Lattices with hidden short vectors and an algorithm for a special case of the SVP

For the purpose of testing algorithms for lattice basis reduction or finding short vectors, it would be useful to have examples of lattices where short vectors are hidden, that is, a nontrivial ...
4
votes
0answers
102 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 ...
4
votes
0answers
234 views

Why is this Trivium implementation working bytewise instead of bitwise?

I am currently looking into a Trivium implementation available in the FELICS framework. Parameters of the Trivium stream cipher: Key size: 80 bit IV size: 80 bit State size: 288 bit The Trivium ...
4
votes
0answers
94 views

Implications of TLS-SRP client with improper N validation?

During development of a client side application of TLS-SRP, i noticed a bug that allows an attacker spoofing as the server to send custom, but non-arbitrary $N$ values, with the client accepting them. ...
4
votes
0answers
213 views

As a cryptographer, what are the things I should care about in my implementation of pairing functions?

As a beginner in cryptography, I do not know anything about different pairing types more than their names. So far, I know these names: Ate pairing, tate pairing, eta pairing, and r-ate pairing. I am ...
3
votes
0answers
58 views

Constant time arithmetic implementation in DSA

I am trying to understand why it is a hard problem to have formally verified constant time arithmetic for DSA when compared with ECDSA. For instance, in ECDSA implementations of OpenSSL, we have ...
3
votes
0answers
96 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 ...
3
votes
0answers
60 views

How can I obtain a code with same weight codewords?

I want to implement "A new one-time signature scheme from syndrome decoding". My first challenge is how to obtain $P$. $P$ is a generator matrix whose codewords have weight not exceeding an integer ...
3
votes
0answers
270 views

How to modify the Socialist Millionaire Protocol to be symmetric.

In the Socialist Millionaire Protocol, the roles of Alice and Bob are almost symmetric. By this I mean they do almost the same thing, until the very last step. In the final step, both parties check a ...
3
votes
0answers
2k views

Understanding the FMS attack on WEP

I am trying to implement the Fluhrer, Mantin and Shamir attack, one of the ways to break WEP. I seem to have hit on a problem. I have no idea whether or not it is a programming error, or if I don't ...
3
votes
1answer
480 views

Standard serialization format for libsodium-based messages

Does anyone know of a standardized serialization format which can be (or already is) widely used for encrypted messages? For a variety of reasons (mostly complexity, age and poor support across a lot ...
2
votes
0answers
20 views

Minimal implementation of GPS identification algorithm from NESSIE project?

I'm studying GPS, asymmetric identification scheme from the NESSIE project. I found a bunch of helpful information about it in the original submission, they even mention minimal implementation ...
2
votes
0answers
47 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
0answers
72 views

Using XL Algorithm to solve overdetermined systems, simple example required

Can someone give an example of how the XL algorithm is used to solve an overdetermined system as apposed to just a general case? I have a fairly good understanding of how steps of the algorithm work, ...
2
votes
0answers
299 views

Blowfish vs. Twofish regarding power consumption

If I wanted to use Blowfish or Twofish to provide security on a device where power consumption is crucial. Regarding power consumption, which one would win? Generally, which algorithms are known to ...
2
votes
0answers
1k views

Keepass Twofish plugin security

Keepass is a well known open-source password manager program, with plugin support. One of the offered plugin is a twofish encryption mode of operation in lieu of the build-in AES algorithm (http://...
2
votes
1answer
95 views

How to construct the blind factors in practice?

I'm Implementing a protocol that uses masking techniques (or blinding factors), so we can mask a value $y_0$ as $m_0=y_0 \cdot r_0$ where $y_0 \in \mathbb{Z}_p$ and $r_0 \stackrel {R}\leftarrow \...
1
vote
0answers
43 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
1answer
51 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 ...
1
vote
0answers
39 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 ...
1
vote
0answers
91 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 ...
1
vote
0answers
110 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
0answers
101 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
83 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 ...
1
vote
0answers
44 views

Gate count for Ring-LWE

In one of my recent research, I need to compare the number of gates needed in Ring-LWE encryption to AES in the circuit model. For AES we can find some estimation like this site, but for Ring-LWE we ...
1
vote
0answers
56 views

What should I change in my implementation to pass from a curve $y^2=x^3+1$ to $y^2=x^3+x$

I tried to change my implementation of pairing in curves $y^2 = x^3 + 1$ to use curves of the type $y^2 = x^3 + x$ but it didn't work. I thought the only thing I had to change in my code was the ...
1
vote
0answers
83 views

Sigma protocol compiler?

Is there a well maintained, preferably documented, Sigma protocols compiler library? i.e. takes an abstraction of statements to prove, and outputs a cryptographic protocol between verifier and prover? ...
1
vote
0answers
76 views

How is pipelined DES different from sequential DES?

I implemented DES Coder in VHDL using ISE IDE by Xilinx in sequential architecture which was pretty easy and straightforward. Now my task is to do the same using pipelined architecture so that the ...
1
vote
0answers
140 views

Fermat's FFT based large integer multiplication

I was going through the documentation of GMP (https://gmplib.org/gmp-man-6.1.2.pdf), specially section 15.1.6 where they refer to the use of Fermat's style FFT. I tried to follow the reference but ...
1
vote
0answers
208 views

Which cryptographic operations can be optimized with a GPU? When shouldn't it be done?

I'm under the impression that GPUs are only used to optimize some (not all) of a given cryptographic operation. Furthermore, I've only seen this GPU optimization done in Bitcoin. This observation ...
1
vote
0answers
147 views

zero knowledge messaging implementation

I understand that messages are encrypted using a symmetric algorithm such as AES, and the symmetric key is encrypted using an asymmetric algorithm such as RSA. In my particular implementation, the ...
1
vote
0answers
106 views

What do the inputs of `hash_df` look like?

I am making an implementation of hash_df (NIST documentation found in SP800-90A.pdf on page 67) I found “Does hash_df use binary or an ASCII hexadecimal ...
1
vote
0answers
68 views

Why does facebook uses two secrets to secure API

I am working on a public API for my personal forum. Concerning the authentification of the requests and responses I plan to hash the payloads with a secret, known to me and the API user, and send the ...
1
vote
0answers
147 views

Issue Factorization Quadratic Sieve

Good evening, I'm about to write my own quadratic sieve implementation in C using GMP library for large numbers. I'm facing an issue while attempting to do the last factorization step for the number: ...
1
vote
0answers
282 views

Example of Projective Coordinates

Given the affine form of coordinates $(x,y)$ such as $(5,3)$, if I want to convert $(5,3)$ to projective coordinates $(x,y,z)$, should the form of point be $(5,3,1)$? It is triplet not a point, right? ...
1
vote
0answers
183 views

How to apply linear cryptanalysis to PRESENT?

Can someone help me implement linear cryptanalysis of the PRESENT block cipher? How should I start with 64 bits of plaintext and 80 bits of key?
1
vote
0answers
750 views

Is there a fast implementation of RSA for Microcontrollers?

Zhe Liu, Johann Großschädl, and Ilya Kizhvatov. "Efficient and Side-Channel Resistant RSA Implementation for 8-bit AVR Microcontrollers" describes a fast implementation, but only contains a sketch of ...
1
vote
0answers
446 views

Does the RSA algorithm use repeated squaring?

Simple question: in order to reduce such huge exponents in modular arithmetic, is repeated squaring used in RSA or is there a better way to implement it?
1
vote
0answers
218 views

Security of .net AES implementation and security of a hash MAC

My question rather splits into two sections: Is AES correctly and security implemented in the .net Framework? Are there any reviews of implementation mistakes that would weaken the security of AES (...
0
votes
1answer
70 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
21 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 ...
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 ...
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 ...
0
votes
0answers
51 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
0answers
136 views

Composing hash functions

Suppose there is a cryptographic hash function $H : \{0,1\}^* \to \mathbb G$. Now, we want to define a hash function $H' : \{0,1\}^* \to \mathbb G \times \mathbb G $. My first idea is to define $H'$ ...
0
votes
0answers
859 views

Python implementation of a blind signature scheme which doesn't involve RSA

RSA seems a bit creepy after the Snowden revelations and i'm looking for a simple python based blind signature library to fiddle around with. So far i've been unable to find anything. What am i ...
-1
votes
1answer
651 views

Problem with implementing DES in python

i'm implementing DES in python and i've stumbled upon a problem i can't really find the problem, after debugging it i narrowed it down to this function, can anyone tell me if i'm implementing the DES ...
-5
votes
1answer
193 views

at rest encrypton question from someone who knows nothing

this forum is way above me and the members here are far, far smarter than I am, so this probaby isn't the place to ask such a simple question, but whatever. All I wanted to ask is for at rest ...