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

7
votes
1answer
91 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
65 views

ECDSA with common nounce?

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 ...
0
votes
1answer
54 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
0answers
35 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
vote
0answers
35 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 ...
0
votes
0answers
27 views

Does it matter whether parameters are inserted in reverse order for Trivium?

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 ...
3
votes
0answers
45 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 ...
0
votes
2answers
46 views

Is one big file as secure as X small files with the same password?

Hello people of StackExchange. It's my first time asking and I know little about Cryptography, so be gentle. My problem can be simplified to this: I can create a 2GB Volume that contains 1GB of text ...
4
votes
1answer
61 views

Can the CRT speed-up Paillier decryption by more than a factor of two?

In the Pailler cryptosystem, decryption goes $m\gets\displaystyle\left\lfloor\frac {\left(c^\lambda\bmod n^2\right)-1}n\right\rfloor\mu\bmod n$ with $\mu<n$ being a part of the private key just ...
7
votes
2answers
146 views

Regular and Efficient doubling in $GF(2^n)$

A naive approach to compute a multiplication $a \cdot b$ in a Galois field of the form $GF(2^n)$ is the russian peasant algorithm. However, it does not run in constant time and therefore is not safe ...
0
votes
0answers
33 views

Using SPDZ over smaller field

While trying to implement SPDZ of a function (using the fresco framework[1]), it enforce me to work on a larger field than the one that I need. This occur because I'm trying to use functions such as "...
3
votes
1answer
89 views

How to securely map messages to points on an elliptic curve

I'm implementing a demonstration hybrid cryptosystem in Python (FinCrypt, I know the name is bad) and I'm migrating over from my Weierstrass curve implementation, which was based off of this, to one ...
8
votes
2answers
992 views

Hardware AES: can we have a decryption implementation only?

I'm wondering if implementing only the AES decryption can reduce the hardware cost? And does anybody have some examples of the cost (speed, size) of hardware AES implementation? Thanks, Abaobaide
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, ...
1
vote
0answers
50 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
1answer
68 views

In a specific Paillier implementation, why is r prime?

I have a question about an implementation of the Paillier cryptosystem. In the description of Paillier above, encryption of a plaintext message $m$ on $\mathbb {Z}_{n^{2}}$, $0\leq m<n$, proceeds ...
2
votes
1answer
52 views

Non interactive Zero Knowledge Proof for Satisfiability of Pairing Product Equations

In the paper "Simulation-Sound NIZK Proofs for a Practical Language and Constant Size Group Signatures" from Groth, the section 6 describes a NIZK proof for pairing product equations. I only know ...
1
vote
3answers
128 views

Is there a consensus on what text encoding to use when hashing a string?

Let's suppose we are hashing a string input from the user via keyboard. A string can be interpreted in many different text encodings (ANSI, UTF-8, UTF-16 and many others). Based on what encoding is ...
0
votes
0answers
78 views

Pairing in implementation of a simple digital signature

I'm trying to implement in python the 1st scheme from the paper "Efficient Identity Based Signature Schemes Based on Pairings" by Hess to learn elliptic curve cryptography. It's a simple digital ...
4
votes
3answers
134 views

How to Calculate GE of Sbox?

How to count Gate Equivalent (GE) of Sbox used in block Cipher. For example how much area does the Sbox of Block Cipher Prince take? And How is it calculated?
5
votes
2answers
880 views

Why do algebraic proofs apply to cryptography?

How do we know that the number theoretic and algebraic results used in cryptography provide a perfect model for the behavior of integers as implemented in computers? Does there exist a bijection ...
2
votes
1answer
135 views

Right way to hash elliptic curve points into finite field

I would like to know how I can implement several hash functions : $H_1:\{0,1\}^* \rightarrow P $ with $P \in E(\mathbb{F}_q)$ and $H_2:P \rightarrow \mathbb{Z_q}^*$ And others where the ...
0
votes
1answer
59 views

Can you create asymmetrical encryption algorithm from symmetrical, without knowing how the algorithm works?

Let's imagine that we have some symmetrical encryption algorithm, that has only two functions: Encrypt(Data, Key) and ...
0
votes
1answer
241 views

Decode & Verify Base64urlUInt-encoded RS256 Public Key from Google

According to Google, to access the id_token it sends along with Access Tokens (for accessing their API), you must first validate the token using the RS256 Public Key available from this page. The ...
1
vote
0answers
42 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? ...
0
votes
0answers
51 views

About practical implementation of Ring-SIS/LWE Based Signature and IBE

In paper: Practical Implementation of Ring-SIS/LWE Based Signature and IBE, authors provided the source code for IBE. In the Extract algorithm, they said: $a \cdot x = u \bmod p$ but I can not ...
-1
votes
1answer
216 views

ECDH over secp256k1 implementation

I'm using ECDH over secp256k1 in multiple languages, and I saw something a little weird in the rust library I use. After the point multiplication it changes y to <...
0
votes
2answers
116 views

UDP and AES with C++

I'm implementing different applications that will use UDP to exchange real-time data, thus a low impact on performance is very important. This system will not be connected to the Internet so I just ...
1
vote
0answers
65 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 ...
2
votes
1answer
80 views

Crypto implementations bits and bytes

Reading many papers in the Homomorphic Encryption domain and in Cryptography, a lot of schemes operate on bits as 1 and 0. If I wanted to implement a scheme, for example Gentry's FHE, would I have ...
1
vote
1answer
62 views

Implementation of ECC operations in BMR

I want to implement computing ECC operations(i.e multiplication) in BMR scheme (secure Multi-party computation) What is the best way to do it? I found Fairplay MPC - to allow BMR computation through ...
2
votes
1answer
255 views

Implementation details of the π step of the Keccak round function

In the official Keccak implementation overview, there is a section discussing different ways to organise the internal Keccak-f state -- namely section 1.2, Bit and byte numbering conventions -- and at ...
3
votes
3answers
121 views

How to thwart a cleartext message's size?

Here is a question I don't find addressed in my cryptography books: let's say Alice want to send Bob a message of length N. what is the proper way for Alice to hide N? I am thinking Alice should do ...
1
vote
0answers
84 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 ...
3
votes
1answer
127 views

Wrong Miller's Weil Pairing implementation?

I tried to implement the Miller's Weil Pairing algorithm in python using the book "An introduction to mathematical cryptography" by Hoffstein, Pipher and Silverman. I tried my code with the example ...
4
votes
2answers
166 views

Why does TWINKLE use light instead of current?

TWINKLE is a device devised by Adi Shamir to optimize the sieving step of GNFS. It consists of a cylinder, at the bottom of which are LEDs corresponding to factor base primes which blink with ...
-1
votes
1answer
165 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) ...
4
votes
1answer
424 views

Varying ECDH key output on different ECC implementations on the secp256k1 curve

Like the title says, I have used several implementations of ECDH, and I have found a discrepancy with libraries that wrap ...
2
votes
0answers
50 views

Using XL Algorithm to solve overdetermined systems, simple example required

Can someone give a small example of how the XL algorithm is used to solve an overdetermined system, with numbers and variables along with the steps if possible as apposed to just a general case? This ...
-1
votes
1answer
64 views

How to compute this equation $(g^k)^\alpha\bmod p$

I have a question about implementation. How is an operation like this implemented? $$(g^k)^\alpha\bmod p$$ With all $g$, $k$, and $\alpha$ being large numbers. The thing that I find tricky is that ...
-3
votes
1answer
141 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 ...
4
votes
0answers
174 views

A Lightweight Matrix Suggestion for MixColumns State of AES

We know that the matrix in the MixColumns state of AES is the circulant MDS matrix $C=circ(2,3,1,1)$ which is defined over $GF(2^8)$ with the irreducible polynomial $f=x^{8}+x^{4}+x^{3}+x+1$. Let we ...
2
votes
0answers
63 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 ...
1
vote
0answers
115 views

What steps are needed for fully homomorphic encryption? [closed]

In my project work, I want to encrypt the keywords extracted from certain documents by using fully homomorphic encryption. What are the algorithmic steps to perform fully homomorphic encryption on ...
1
vote
1answer
127 views

Is streaming API to ChaCha20-Poly1305 possible or recommended against?

None of the implementations of ChaCha20-Poly1305 AEAD scheme I've seen so far provide a streaming API. Instead, ChaCha20-Poly1305 is presented as an inseparable combination, closely adhering to the ...
-1
votes
2answers
163 views

Can duplication of encrypted characters lead to a weakness in RSA?

Of course, I know RSA is to widely used and tested to have any legitimate threats, but I still am confused by this. I have been trying to implement C++ (in a effort to learn how it works, not to be ...
4
votes
0answers
54 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. ...
7
votes
1answer
409 views

Does a conditional statement depending on a round number introduce timing attack problems?

In a cryptographic implementation I’m playing with, there’s a round function which includes a conditional if statement. Stripping the superfluous stuff, the C ...