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

learn more… | top users | synonyms

0
votes
0answers
6 views

Questions about Scyther tool

everyone, I want to use Scyther tool to do a project about security protocol analysis but met some problems when I wanted to get familiar with the tool. I used the codes in the Scyther website but ...
0
votes
0answers
34 views

Questions about a SHA3 cipher stream encryption scheme

I've written an encryption implementation using a hash as a cipherstream FOR DEMONSTRATION PURPOSES. I know it is slower than more sensible options such as AES but I'm interested in several things, ...
0
votes
0answers
34 views

What are the pre-requisites I need to be able to code Salsa20 in C#?

I've taken a basic course in Cryptography and we've learnt various algorithms and their usage. I've implemented RC4 and Triple DES in C# with ASP.NET. For a project that I am a part of, I need to ...
-1
votes
0answers
42 views

Encryption of Real Time UDP packet

I am planning to work on real time UDP packet encryption. I have a server which generates fixed size UDP packets at every 200ms and this message is sent to the receiver application which receives this ...
3
votes
2answers
112 views

HW acceleration for Camellia cipher (x86_64/AES-NI/AVX2)

Modern processors support hardware acceleration for various crypto functions such as AES directly, or general vector operations which can be used in crypto ...
3
votes
1answer
64 views

How to convert AES to a PRNG in order to run NIST Statistical Test Suite?

I want to run statistical tests on my implementation of AES. How should I convert it into a PRNG? Is there a standard way to go about doing this? I could not find much information about this although ...
2
votes
1answer
63 views

Why does image size increase after steganography?

I am working on a steganography technique. Sometimes I need to send my steganographed images online to my friends but in the process the image gets compressed destroying all the data. I found ways to ...
3
votes
1answer
37 views

What information should I send along with an AES ciphertext and is there any standard to do that?

While using some crypto implementations I got to see that many times a comment is added to the ciphertext. For example: ...
0
votes
0answers
23 views

Implementing cryptosystems with various programming langauges

I know that most cryptosystems are currently implemented in C/C++. Has there been any effort to implement cryptosystems in programming languages such as Agda where proofs can be written about ...
1
vote
2answers
114 views

How can comparision like (>=,==) be done using homomorphic encryption?

Since we know that Homomorphic encryption allow computation on encrypted data. Let two n-bit integers $(x,y)$ are encrypted using some LWE public key cryptography. For example - if $x'= HEnc(x,pk)$ ...
3
votes
2answers
90 views

System parameters in identity-based encryption

In IBE schemes, the system parameters are $(q, \mathbb{G}, F, \hat{e}, P, Q, T, H_1)$. I don't know $\hat{e}$. For example, in type A pairing… ...
4
votes
1answer
128 views

Full encryption of IDs, partial decryption with customer specific key

I am looking for a "partial" encryption/decryption algorithm. Let's say I am encrypting the following List of IDs (long values) $[1,2,3,4]$ (with a secret key) to an encrypted string $e$, I would ...
2
votes
0answers
40 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
32 views

Convert projective to affine coordinates in ECC? [closed]

I am working with my project. I use projective coordinates but when I convert to affine coordinates, I can't get it. Can anyone help me? Projective Coordinates $(X,Y,Z)$ to Affine Coordinates ...
1
vote
1answer
66 views

Non-numeric Diffie-Hellman?

It may seem that this is a programming question, but I just need advice on the cryptography side of the question. I want to implement the Diffie-Hellman key exchange algorithm on iOS (since no free ...
4
votes
1answer
53 views

Is it secure to use hexadecimal data for IV instead of raw binary?

Is it safe and secure to use a function like bin2hex (which converts binary data to hexadecimal) on the binary output of functions like ...
5
votes
1answer
38 views

What is the difference between MACTripleDES and TripleDES?

I was asked to encrypt/decrypt a string using MACTripleDES. Is there any difference between MACTripleDES and TripleDES? If, where exactly is the difference between both?
0
votes
1answer
24 views

Would buffering socket send resist timing attacks

I have been reading and thinking about timing attacks on cryptographic systems. The answer to this question mentions the following: "The way to defend against timing attacks is to make sure the time ...
5
votes
1answer
77 views

Difference between Hardware implemented algorithm and software implemented one?

In the articles about cryptography I see the words Hardware implemented and Software implemented. I'm curious to know what is the difference between them? In the other words, even in the computer ...
1
vote
1answer
80 views

What libraries do people use to implement and evaluate cryptography protocols?

I want to implement this credential system: “Anonymous Credentials Light” (PDF). The implementation would involve some zero-knowledge proof and some exponentiation. For some basic group computations ...
6
votes
1answer
64 views

Choice of the one-way function (OWF) for Lamport signatures

I am studying the Lamport signature scheme, and I found that in many sources (eg: Hash-based Digital Signature Schemes) the input and output bitstring of the OWF and the message digest have the same ...
3
votes
2answers
70 views

Implementation of ECC over binary field

I am supposed to implement ECC over binary field (in C++) for equations of the type - $y^2 + xy = x^3 + ax + b$, as my project. I wish to include the following features : The user will enter a prime ...
1
vote
0answers
25 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?
3
votes
0answers
24 views

Seeking an implementation of the Satoh algorithm for elliptical curve point counting

I would be very grateful if someone has an implementation of the Satoh algorithm (Fast Elliptic Curve Point Counting). Can someone point me to practical algorithm implementations or provide some ...
1
vote
1answer
46 views

What is a good algorithm to scramble data in a 2-D grid

I want to know if there exists an algorithm i can use where the input is a string of data and the output is a scrambled version of the same but in a 2 D array ie given something like: |1 2 3 4 5 6 ...
0
votes
0answers
37 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 ...
0
votes
1answer
72 views

What are the security implications of an AES implementation that uses only 8-bit byte operations on the cipher state?

Some AES implementations in crypto libraries make use only 8-bit byte operations on the cipher state, like in the lorawan-parser (cf lib/aes.h). When I try to understand the implications of that, I ...
3
votes
1answer
70 views

Problem reproducing AES results

First of all, I just implemented AES because I wanted to understand how it works and as a challenge to see if I could do it and I won't use to encrypt anything important, ever. The (German) Wikipedia ...
1
vote
0answers
65 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?
2
votes
0answers
34 views

Reference AES-NI assembler code for AES-128-GCM? [closed]

I want to implement AES-128-GCM in assembler using Intel AES-NI instructions. I have found reference code in the Intel AES-NI Whitepaper but I don't see code for the GCM mode there (or indeed any use ...
8
votes
1answer
144 views

Branchless AES Implementation

Imagine a branchless implementation of the AES-128 cipher. Are there any benefits over the implementation that contains branches, other than possible prevention of timing attacks? Is it even true, ...
0
votes
1answer
37 views

Is there a library-less implementation of DSA available to read? [closed]

Is there a pedagogical library-less implementation of DSA available to read? (Not ECDSA.) Obviously BigInteger and hash functions may be from libraries, but I want to read the implementation of all ...
8
votes
3answers
245 views

How is bitslicing faster?

I have read a paper on Bit Slicing and Lightweight crypto but cannot understand how bitslicing makes encryption scheme faster. Please can someone explain with an example exactly how bit slicing makes ...
3
votes
1answer
77 views

Fast reduction in $GF(2^{128})$ using x86 `PCLMULQDQ`

Modern x86 CPUs support the PCLMULQDQ instruction, which does an XOR-multiply of two 64-bit numbers instead of an add-multiply (i.e. typical arithmetic ...
2
votes
1answer
166 views

RSA Signature Verification Implementation on Cortex M0

I have to implement RSA Signature Verification procedure (RSA-2048) on a Cortex M0 based MCU. My budget is 15kB Flash and 2-4kB Flash RAM. Is it even possible to do RSA on a low end MCU based on ...
2
votes
1answer
51 views

Is succinct verification of an arbitrary data transformation theoretically possible? Is it feasible? How?

Given input string S, and transformation (i.e. computer program) T, is it possible to provide a succinct proof that another binary string S' is identical to the output T(S)? By "succinct", I ...
3
votes
1answer
205 views

Encrypt with one cipher and decrypt with a different cipher?

I recently installed an android app called Secret Space Encryptor and think I found a serious flaw in it. Let me explain: This app provides a variety of different ciphers to use and I used Threefish ...
11
votes
1answer
180 views

Edwards / Montgomery ECC with Weierstrass Implementation?

So let's assume I want to perform Ed448 or Ed25519 digital signatures or want to perform a DH key-exchange. Assume further that those curves (Curve448 or Curve25519) are required. But the problem is, ...
1
vote
1answer
44 views

Authenticating with a document

Hope you're having a nice day. I need to implement an authentication system between a "document" (it's not exactly a document, but an object without any computing capacity, only able to store ...
3
votes
4answers
279 views

Cryptography and FPGA

I see a lot of papers about FPGA implementations. For what kind of "concrete" application should we implement cryptographic algorithms on FPGA ? Which secured application require such a huge data ...
3
votes
0answers
66 views

Are there simpler FHE methods than Craig Gentry's original paper?

Craig Gentry's 2010 paper on FHE is very cool, and I'm planning on implementing a basic proof of concept FHE. I was wondering though, are there any simpler methods that have been discovered since ...
8
votes
1answer
1k views

Why do crypto libs use table lookups when they're vulnerable to timing attacks?

AESEngine.java, from BouncyCastle, uses table lookups as does aes_x86core.c, in OpenSSL. But per Cache-timing attacks on AES table lookups like what OpenSSL and BouncyCastle are doing are vulnerable ...
2
votes
1answer
61 views

Can string lookups be vulnerable to timing attacks like array lookups are?

Per “Can non-assembly crypto libraries truly be secure against timing attacks?”, array lookups are vulnerable to timing attacks. Like, if you do cresult[map[i]] and ...
7
votes
1answer
164 views

Can non-assembly crypto libraries truly be secure against timing attacks?

http://cr.yp.to/antiforgery/cachetiming-20050414.pdf states the following: So what went wrong? Answer: NIST failed to recognize that table lookups do not take constant time. “Table lookup: not ...
1
vote
0answers
65 views

Library to find an addition chain for a large number? [closed]

I need a short addition chain for a number $n>2^{100}$ in order to implement a fast exponentiation. The memory footprint is not important. Finding an optimal chain for a large number $n$ is ...
4
votes
4answers
462 views

Are specially designed fonts sometimes used in cryptography?

As a font designer, I was thinking that it would be very easy to design a special font that could either jumble characters of a language (or of a code) or simply (with the features offered by the OTF ...
4
votes
1answer
178 views

Parallelization of CFB mode encryption and decryption

While reading Evaluation of Some Blockcipher Modes of Operation by Rogaway (someone just linked it somewhere), I noticed two claims about CFB that I'm not sure I understand: Regarding whether CFB ...
1
vote
1answer
263 views

Discrete Logarithm (512 bits numbers) - Find exponent parameter

I'm trying to resolve a discrete logarithm equation: $$y = g^x \bmod p$$ Every parameter is a 512-bit number. I know the values for $g$, $y$ and $p$ and I need to find the $x$ value. Finally, I know ...
4
votes
1answer
140 views

Implementing AES MixColumns with fewest XOR gates

I'm playing with Contiki (O.S. for constrained devices such as sensors and micro-controllers) and particularly with the AES encryption in software (the one available in Contiki source code). I'm ...
0
votes
0answers
67 views

Understanding the PRINCE cipher linear layer

I am struggling to understand how to implement the PRINCE cipher linear layer. (https://eprint.iacr.org/2012/529.pdf) From my understanding I need to multiply the state with M, and with M' in between ...