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
3 answers
192 views

Do we want to allow/Have we allowed parallelization (e.g GPU programming) to enter the cryptographic field? What are the consequences?

With the term GPU programming, I'm referring to highly parallelizable computing in general. Lastly, I have built a bit of a background in cryptography. So I have started to wonder if/where GPU ...
user avatar
  • 502
0 votes
0 answers
26 views

Is there a common method for a virtual two way dictionary of statistically independent random values with a domain size of about 192bit? (like ECB BC)

Is there any commonly used dictionary/codebook like function $D$ which assigns for every value $r_i \in V=[0,s-1]$ with $s\approx 2^{200}$ a value $r_j$ also $\in V$ $$D(r_i) = r_j$$ and is self-...
user avatar
  • 475
1 vote
0 answers
56 views

Minimal, secure and reasonably efficient P384 implementations

For a project I'm working on, I need to implement ECDSA over the NIST P-384 curve (AKA secp384r1). For what it's worth, the choice of curve is beyond my control in ...
user avatar
  • 111
2 votes
1 answer
65 views

Is this half-smart way of verifying EdDSA signature secure?

In the final step of verifying an EdDSA signature, 4[S]B is compared to [4]R + [4][k]A. Because I'm using the XYTZ - extended ...
user avatar
  • 6,621
-2 votes
1 answer
44 views

Straightforward modular arithmetic for power-of-two moduli [closed]

Why if $q$ is a power-of-two integer, then doing arithmetic modulo $q$ (addition and multiplication) is very efficient and straightforward?
user avatar
  • 365
4 votes
2 answers
1k views

Are there prime numbers that are easy to modulo within 40 bits to 60 bits?

I want to implement LWE-based encryption scheme, the modulo $q$ could be decomposed as $q = q_0\cdot q_1\cdots q_k$ according to CRT. I guess the modular arithmetic by $q_i$ is key operation, so I ...
user avatar
  • 389
0 votes
0 answers
25 views

Reference Implementation of RLWE-Based schemes?

Now RLWE-based Encryption scheme is so popular because of its post-quantum property and application in Homomorphic Encryption. I am trying to get more familar with RLWE-based Encryption by ...
user avatar
  • 45
3 votes
1 answer
100 views

What is the most viable and common hardware for public key cryptography implementation?

I am an FPGA engineer and my last experiences were related to digital communication implementation. I am about to start an experience for the cryptography market. In digital radio communication, FPGA ...
user avatar
2 votes
1 answer
122 views

Generating and validating a signature with ED25519 expanded private key

I am building a encrypted messaging app over tor network and currently I'm struggling on using tor generated ed25519 private key to sign and verify any message. Below piece of code works with a 32 ...
user avatar
  • 21
4 votes
2 answers
367 views

Difference between FFT and NTT

What are the main differences between the Fast Fourier Transform (FFT) and the Number Theoretical Transform (NTT)? Why do we use the NTT and not the FFT in cryptographic applications? Which one is a ...
user avatar
  • 365
0 votes
0 answers
22 views

Fast implementations in c++ to find linearity of 16! sboxes?

I have to analize 16! of 16 bytes sboxes but my code is to slow to handle it. Anyone have any fast implementation on that? Thank you.
user avatar
4 votes
1 answer
275 views

Notion of base2-logarithm in RC6 specification

I was reading this paper on RC6 and formally, the algorithm is defined for an arbitrary word size $w$, even though only $w=32$ was considered for the AES submission. Now the paper explicitly mentions ...
user avatar
1 vote
0 answers
40 views

Implementation of a "running hash" on constrained devices

The following link documents a proposal for a TLS-like alternative for constrained devices. https://github.com/lake-wg/edhoc/blob/4f56898808989e449cc412a8b136674202a0ddce/draft-ietf-lake-edhoc.md#...
user avatar
  • 1,313
1 vote
1 answer
43 views

Applicability of RFC-6090 point doubling formula in homogeneous coordinates

I'm referencing RFC-6090 for a hobbyist implementation of elliptic-curve cryptography. I've opted for an exception-free (the answer pointed me to this paper) formula for point addition and thought - I ...
user avatar
  • 6,621
0 votes
0 answers
61 views

How is the polynomial multiplicative inverse calculated here? [duplicate]

How is the multiplicative inverse calculated in the following? Please explain with details. Note: I understood how polynomial value 283 is calculated.
user avatar
0 votes
3 answers
188 views

How to generate constraint on right shift bitwise operator in Circom

How to generate constraint on right shift bitwise operator in the circom circuit language? I'm trying to do the following: ...
user avatar
1 vote
0 answers
79 views

Where can I find the source of the Coppersmith method univariate in C with GMP library?

Could someone please tell me where I can find the source code of the Coppersmith method univariate written in C with the GMP library? to be fair I will explain how I will use it for factoring ...
user avatar
0 votes
0 answers
27 views

EC implementation on Edward curves : what modulo is used in implementation?

I'm trying to implement EC scalar multiplication in the fastest way possible (but still with a good curve) on a GPU. I'm specifically looking to implement it based on https://github.com/Chair-for-...
user avatar
  • 101
0 votes
0 answers
173 views

How to implement a basic "sponge function"?

In Chapter 6 of Serious Cryptography, they write about the sponge function: It XORs the first message block, M1, to H0, a predefined initial value of the internal state (for example, the all-zero ...
user avatar
  • 161
3 votes
1 answer
101 views

Is there any "exception-free" coordinates system for Weierstrass curves?

I'm referencing RFC-6090 for an attempt at implementing ECC in my spare-time project. In the RFC, pseudo-code examples are given to illustrate how to handle points-at-infinity in point arithmetic, and ...
user avatar
  • 6,621
2 votes
1 answer
49 views

How to determine whether a point is at infinity in homogenous coordinates?

I'm implementing ECC in my spare time project. I'm referencing RFC-6090 for point arithmetic algorithm over homogeneous coordinates. In Appendix F subsection 2, there are 5 case labels when ...
user avatar
  • 6,621
0 votes
1 answer
246 views

Where is the specification for SHA1PRNG?

I searched for the algorithm of the SHA1PRNG, which is implemented in Java's SecureRandom Class. Does anyone know how this algorithm works exactly? I have not found a source where the algorithm is ...
user avatar
2 votes
1 answer
51 views

Is there an algorithm to compute the wNAF for an exponent faster than quadratic?

For doing exponentiation in a group for which inversion is trivially easy, such as elliptic curve groups, is there an algorithm for computing the $w$NAF ("$w$-ary non-adjacent form") array ...
user avatar
  • 2,214
2 votes
1 answer
147 views

How to have a hash function that maps any binary string of size n to binary string of size n?

I am implementing certificateless cryptography from this research paper in python language. Essentially, I want to have the following hash function mapping. This hash function is mentioned in the ...
user avatar
  • 43
0 votes
0 answers
75 views

Homomorphic Encryption Library Supporting Addition, Multiplication & Logical Shift

Does anyone know of a C++ homomorphic encryption library that supports addition, multiplication and logical right shift over integers? Some set of instructions that allows the implementation of ...
user avatar
  • 101
2 votes
1 answer
119 views

Sage code for finding generator matrix of MDS code

Let $L$ be an $[n,k]$ code. A $k\times n$ matrix $G$ whose rows form a basis for $L$ is called a generator matrix for $L$. A linear $[n,k,d]$ code with largest possible minimum distance is called ...
user avatar
  • 23
0 votes
1 answer
53 views

RSA Blind Signatures Secure Implementation

note: I am not a crpytographer I want to check if my RSA Blind Signatures Implementation is secure to be used in a production-stage application and I also have some questions which I would be so ...
user avatar
0 votes
1 answer
139 views

Fernet symmetric-key encryption

Fernet symmetric-key encryption To encrypt and provide data — e.g. JSON strings in a database — using Python I'm wondering what is a good approach (package) for symmetric-key encryption. The Python ...
user avatar
  • 103
0 votes
1 answer
36 views

How to test Salsa20/8 Core RFC 7914 implementation with the test vectors?

I wanted to test the implementation of the Salsa20/8 Core function provided in the RFC 7914, with the test vectors provided, and I do not get the expected output from provided input. I guess that I am ...
user avatar
  • 11
3 votes
1 answer
116 views

The better algorithm for Modular Exponentiation on secp256k1/r1

I know Modular Exponentiation ($r = b^e \bmod m$) is important for RSA, and I can find some algorithm that if e is expressed in binary form (for exp: )--in such way for a n-bit long e, one can expect ~...
user avatar
  • 111
2 votes
4 answers
202 views

What can chaos provide to cryptography?

Chaos-based cryptography is facing a lot of criticism, however, some people argue that it can provide many cryptographic primitives, such as stream ciphers, block ciphers, hash functions, public-key ...
user avatar
  • 435
0 votes
0 answers
37 views

Are there any implementations of "More Fun With Funky Plaintext Spaces" from the BGV paper?

Fully Homomorphic Encryption without Bootstrapping describes considerations for large (exponential in the security parameter) integer plaintext spaces in Section 5.4, "More Fun with Funky ...
user avatar
0 votes
0 answers
32 views

Are there any Enveloped Merkle-Damgård implementations?

I'm implementing "Enveloped Merkle-Damgård" and I would like to verify I undestood notation in papers describing it. Is there any hash function using "Enveloped Merkle-Damgård" so ...
user avatar
  • 1,322
0 votes
1 answer
63 views

How to extend operations from numbers to larger "objects" in cryptographic implementations?

I know I'm not supposed to roll my own crypto, but everyone starts somewhere! I'm implementing the PSI-CA protocol defined in Fast and Private Computation of Cardinality of Set Intersection and Union (...
user avatar
0 votes
2 answers
287 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 ...
user avatar
  • 11
1 vote
0 answers
87 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 ...
user avatar
1 vote
1 answer
197 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?
user avatar
1 vote
1 answer
98 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$...
user avatar
2 votes
0 answers
32 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 ...
user avatar
  • 21
1 vote
0 answers
90 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 ...
user avatar
0 votes
1 answer
106 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 ...
user avatar
3 votes
0 answers
120 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 ...
user avatar
  • 85.1k
2 votes
1 answer
67 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 ...
user avatar
4 votes
2 answers
361 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 ...
user avatar
7 votes
1 answer
284 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, ...
user avatar
0 votes
1 answer
65 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/...
user avatar
  • 103
0 votes
0 answers
164 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 ...
user avatar
9 votes
3 answers
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 ...
user avatar
  • 1,492
0 votes
2 answers
67 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 ...
user avatar
1 vote
0 answers
112 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 <...
user avatar

1
2 3 4 5
10