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
2answers
75 views

CSPRNG in Javascript?

I'm trying to obtain a random, unpredictable quite long number (± 20-25 digits) using Javascript (created by user's client) as fast and light as possible. Is this solution reliable, robust and secure ...
0
votes
0answers
33 views

What's the performance of the HElib and SEAL?

HElib contains the CKKS and BGV, SEAL contains the BFV and CKKS, is there some concrete performance data about these two lib?
1
vote
0answers
58 views

NTRU cryptosystem on complex numbers

Background I am interested in lattice-based cryptography. Recently I got familiar with the NTRU cryptosystem and found out that it can be extended onto hypercomplex numbers, like Quaternions (QTRU) or ...
1
vote
1answer
151 views

What are the algorithms used in Facebook's Diem algorithm?

Facebook plan a new cryptocurrency release called Diem. What algorithms are used? What output size is used for the hash function?
1
vote
1answer
97 views

What are the algebraic normal forms for each bit of $z$, where $z = (x \oplus y) \oplus ((x \wedge y) \ll 1)$ (a non-linear operation in NORX)?

Let $x, y, z$ denote three $n$-bit words such that $$z = (x \oplus y) \oplus ((x \land y) \ll 1).$$ The NORX paper contains the generalized description of the algebraic normal forms for each bit of $x$...
2
votes
0answers
26 views

Does anybody have test vectors for the LBlock block cipher?

LBlock is a lightweight block cipher with 64-80 bits block-key size, designed by a group of Chinese scholars. Does anybody have LBlock test vectors? I am looking for test vectors, which contain the ...
0
votes
0answers
19 views

Want to implement a cipher efficiently on Hardware with verilog, is there any standard resources to start?

I want to implement a new block cipher on hardware. The cipher has a look-up table and the rounds are not self-similar. So, the code size, as well as the chip area, is expected to be larger. I just ...
1
vote
0answers
39 views

Multiplication in Tower Field $GF(2^4)^2$

I'm currently reading an article which deals with "Squeezing Polynomial Masking into Tower Fields " for performing an efficient multiplication of elements in $GF(2^8)$. Thereby it is ...
0
votes
1answer
63 views

How does this generate a permutation?

In the process of trying to answer this question, I ended up getting stuck. I found a paper which seems to solve their issue: its authors define a process which yields a pseudorandom permutation ...
3
votes
0answers
54 views

Which parts of CRYSTALS-Kyber and CRYSTALS-Dilithium are compatible?

The papers CRYSTALS-Kyber and CRYSTALS-Dilithium both have been written by quite different authors. It seems that at least the key generation is very different from each other. CRYSTALS mainly seems ...
2
votes
1answer
64 views

Is a Test Vector feature a Security Hole?

I have a system where a block cipher key (likely AES) is entered via a 'command line' over a serial console, probably as hex. The system has no 'print key' feature, so the key is hopefully 'ingest ...
4
votes
2answers
301 views

Is FFT for power-of-two cyclotomic rings possible if q is not 1 modulo 2n?

For RLWE (Ring Learning With Errors) scheme, we use $R_{q} = \mathbb{Z}_{q}[x]/(x^{n} +1) = \mathbb{Z}_{q}[x]/(\Phi_{2n}(x))$ where $n = 2^{d}$ for some $d$. Since there exists $2n$-th root of unity ...
7
votes
1answer
227 views

Expandable hash function

I have been studying a cryptosystem using Mersenne primes. More specifically, this paper. I have implemented this cryptosystem in Python, but I am missing the key encapsulation system. On page 12, ...
0
votes
1answer
56 views

Do I need to implement multi precision arithmetic operations?

I want to implement Elliptic Curves arithmetics (for edu purpose and better understanding) for special NIST primes: point addition, exponentiation, etc.. all operations needed for EC encryption/...
0
votes
0answers
35 views

Where to get AES GCM NIST-like test cases

I'm implementing AES GCM 256 bit at the moment. Now I'm finished with copying the content of the standard as a program and now have to make it actually work. With the test cases in the official NIST ...
9
votes
3answers
2k views

Benefits of functional programming languages

So far I mostly saw Python (because of simplicity) and C (because of efficiency) for cryptographic programming. But there is a different kind of programming languages called functional programming ...
0
votes
2answers
61 views

How to verify most appropriate cleartext?

So basically I was implementing a decryption tool (just for fun) and the first encryption logic I decided to implement was Caesar Cipher. So if I have the input as ...
1
vote
0answers
62 views

Test vectors for FF1/FF3-1

I'm working on a C implementation of the FF1 and FF3-1 format-preserving encryption algorithms, here. For FF1, NIST provides test vectors, here; however, none of the test vectors is crafted such that <...
1
vote
1answer
39 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
69 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
68 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
69 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
51 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 ...
1
vote
1answer
70 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
117 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 ...
2
votes
0answers
68 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
53 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
312 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
143 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
51 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
29 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
291 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 ...
1
vote
1answer
143 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
66 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
16 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
106 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
833 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
27 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
86 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
57 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
344 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
215 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
315 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
73 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
135 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
32 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
60 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
254 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
140 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 (...

1
2 3 4 5
10