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
1
vote
1answer
34 views

EdDSA point encoding difference between documentation and implementation

The RFC 8032 describes the point encoding like this : A curve point (x,y), with coordinates in the range 0 <= x,y < p, is coded as follows. First, encode the y-coordinate as a little-endian ...
1
vote
0answers
43 views

Security of an ECDSA Adaptor Signature Implementation

I'm currently working on an implementation of ECDSA Adaptor Signatures, and part of the signature scheme calls for a NIZK proof to verify knowledge of exponent over two public keys that share a ...
2
votes
0answers
54 views

Depth of $\operatorname{SHA-256}$ implementation by fan-in $2$ and fan-out $1$ Boolean circuits?

A fan-in $2$ and fan-out $1$ Boolean circuit is a circuit consisting of $\operatorname{AND}$, $\operatorname{OR}$ and $\operatorname{NOT}$ gates where number of inputs to $\operatorname{AND}$ and $\...
0
votes
2answers
61 views

AES Implementation for Image Encryption

I've been delving into cryptography for fun and trying to implement a visualization for AES using image encryption. So far, represented each pixel's RGB values as hexadecimal numbers, then split it ...
0
votes
1answer
34 views

Software implementation of symmetric and asymmetric bilinear pairings

I have recently read a paper about pairings, which only implemented asymmetric bilinear pairings and it mentiond that $\eta_{T}$ pairing is the most efficient algorithm for symmetric pairings. I ...
0
votes
1answer
54 views

Has Burdges and De Feo's concept of Delayed Encryption ever been implemented?

In mid 2020 Jeffrey Burdges and Luca De Feo published a paper proposing a trapdoor-less time-lock puzzle called Delay Encryption. Has a prototype of this ever been made?
2
votes
1answer
108 views

How to ensure that a cryptographic implementation is reasonably sound/robust?

I know from the bottom of my heart how bad the idea of custom-crypto is. I absolutely concur with the recommendation that it should only be done by professionals who specialize in implementing crypto ...
0
votes
0answers
21 views

How to implement AES in crypto++ which is applied multiple times to an input? which AES mode? [migrated]

For my target application I want to use AES multiple times in a row for a given input. After encrypting it $i$ times in a row it should result in same starting input if decrypting it $i$ times ...
2
votes
0answers
64 views

Is this “AND” implementation safe against side channel attacks?

I found out that the following is a working implementation of calculating an AND function between XOR masked shares, implementation at Github. It works by calculating parities, whose terms cancel each ...
0
votes
1answer
45 views

Can Hash Functions take fixed-size input?

I‘ve argued for quite some time with a friend about wether or not this C# method can be qualified as a Hash Function. ...
5
votes
2answers
296 views

Recommendation of lightweight RNG for Miller-Rabin primality test

Miller-Rabin tests the compositeness of candidate numbers (hence, input $x$) that's often used as a primality test. The M-R test requires different random numbers for accuracy and confidence in the ...
2
votes
2answers
132 views

How to handle modular arithmetic with regard to two's-complement negative numbers?

The reason for asking, is that this occurs in real life with CRT calculation of RSA decryption/signing. In CRT RSA, there's the need to calculate subtraction, and it's known negative numbers could ...
0
votes
1answer
44 views

Creating SHA256 constant values on the fly without memory usuage

Is it possible to create the constants used in SHA256 on the fly? Meaning I dont have to reserve 64 32-bit words of space? It would result in a slower implementation, but at the profit of using less ...
1
vote
0answers
24 views

For most applications of CMS, does the size of the payloads ever exceed that of a 32-bit integer?

For my hobby cryptography project, I'm planning to implement some helper functions that parses a subset of ASN.1 BER encoding without using a ASN.1 compiler. For this purpose, I'd like to use 32-bit ...
2
votes
4answers
287 views

Proof of number of logins in last N days without saving login times

Let's say we have an user Bob. User Bob logs in into our web application every so often. We are a website that tries to save as little information about our users, however we'd like to know which ...
0
votes
1answer
90 views

How to map output of hash algorithm to a finite field

I would like to know an algorithm hash to a finite field. I have an $l$ bit prime number $q$. I want setup a hash function $H: \{0,1\}^* \to \mathbb F_q$ but I do not know how I can do it. I use a ...
0
votes
0answers
34 views

Is there an Elgamal implementation in javascript?

Does anyone know a good, well known implementation of ElGamal encryption and decryption in JavaScript? I was told that Stanford Javascript Crypto Library https://github.com/bitwiseshiftleft/sjcl/ ...
0
votes
0answers
12 views

CP-ABE (partially hidden access structure)

Anyone aware of the implementation of paper "Lai, Junzuo, Robert H. Deng, and Yingjiu Li. 'Expressive CP-ABE with partially hidden access structures.' 2012" specially in python or Charm ...
1
vote
1answer
84 views

Securing communication between limited embedded systems

I am currently trying to harden communication over a limited physical communication channel on an embedded system. The Scenario I think the system is rather typical for small embedded applications: ...
4
votes
4answers
1k views

How was AES Encryption cracked on my app?

I built an app that used AES encryption with 16 characters Key and IV. It seems it could easily be hacked, as someone did it in a day. I feel that I made a few mistakes Used key & IV which was ...
10
votes
2answers
806 views

What is a “constant time” work around when dealing with the point at infinity for prime curves?

I've been working for some time, on designing a constant time solution for dealing with the "point at infinity" for prime curves. So, far I'm using the Standard Projective Coordinates for ...
2
votes
0answers
23 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 ...
3
votes
0answers
76 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 ...
2
votes
1answer
52 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
246 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
166 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
301 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
61 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
124 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
28 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
59 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
154 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
129 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
79 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
22 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
182 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
54 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
64 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
186 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
132 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
166 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
210 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
89 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
56 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
67 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
300 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
56 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
545 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 ...

1
2 3 4 5
9