Questions tagged [encoding]
Encoding is the act of transforming information from one form to another. In cryptography, encoding is typically used to refer to an unkeyed process that does not provide any security in itself, but just changes the representation of information into a more convenient form.
140
questions
0
votes
1
answer
32
views
Probability of encoded message using Weierstrass equation on NIST elliptic curve over prime finite field to return a quadratic residue?
Suppose we talk about NIST P-256 elliptic curve, and since finite field of an elliptic curve is a known prime number $P$, then approximately half of the Weierstrass equation results will be quadratic ...
0
votes
1
answer
68
views
Elliptic curve short Weierstrass equation that always returns a quadratic residue modulo curve field?
Currently I'm encoding my message using short Weierstrass equation $y^2 = x^3 + Ax + B$ and elliptic curve is NIST-P256, which has $A$, $B$ and $P$(elliptic curve field size) known. Encoding itself is ...
0
votes
0
answers
50
views
CKKS encoding. Why not just use fft
I am studying the ckks scheme from this blog post. In the vanilla encoding part we want to encode a complex vector of size N to a complex polynomial of degree N-1. This of course is possible if we ...
1
vote
1
answer
40
views
Why use coordinate-wise random rounding instead of regular rounding?
I've been reading a blog article on CKKS encoding and there they implement a coordinate-wise random rounding algorithm (which can be found in this paper) instead of the plain old rounding. The same ...
1
vote
0
answers
35
views
Sparse Packing for CKKS
Let $N$ be a power of two integer and $n$ be a divisor of $N$. We can encode a vector in $\mathbb{C}^{N/2}$ into the polynomial ring $R=\mathbb{Z}[X]/(X^N+1)$ as described in the original CKKS paper ...
0
votes
0
answers
35
views
What format to use to store private and public key in one file other than a PKCS12 keystore?
TLDR
I want to generate an X25519 keypair and then store it in a single file for easier handling, but I cannot use a keystore like PKCS#12.
Why
OpenSSL makes it quite easy to generate a private key in ...
1
vote
1
answer
97
views
Is injective encoding of a message important for Elliptic Curve ElGamal?
I'm trying to understand if using non-injective encodings for Elliptic Curve ElGamal encryption is dangerous.
A standard probabilistic encoding defined by Koblitz for elliptic curves over $\mathbb{F}...
0
votes
0
answers
30
views
How to express the Boolean cardinality constraint to CNF formulas
A Boolean cardinality constraint
$$\sum_{j=0}^{n-1}x_j=k,$$
where $x_j$’s are Boolean
variables, and $k$ is a non-negative integer.
How to express the Boolean cardinality constraint to CNF formulas?
2
votes
1
answer
158
views
Constant-Time Base64 Codec - Necessity and Implementation
As we know, the popular PEM format for textualizing private key binary blobs uses base64 encoding. Typical base64 codecs use look-up tables to find characters and byte values and pack them together, ...
1
vote
1
answer
57
views
How to process a message to be embedded using steganography?
Let's say we embed a text using steganography by modifying an existing cover object.
What would be the steps needed to be done on the message?
I can think of
source coding (compression)
channel ...
0
votes
1
answer
60
views
Transform a large integer to Plaintext ERROR in SEAL Library
In SEAL library, I want to multiply a BFV ciphertext ct with an integer inverse. Here are what I do:
Compute the integer inverse as follows:
...
1
vote
1
answer
145
views
Enigma Questions: Eliminating the can't encode to itself flaw? Maybe not a flaw
I am currently writing a paper in my old age for the fun of it. I feel that the enigma machine had gotten a bad wrap for some of its flaws. I decided to write a machine simulation to see if I can ...
3
votes
1
answer
1k
views
Why does "hex encoding of the plaintext before encryption", "harm security"?
This arose from a recent question's comment. Why is translating to Welsh less secure than encrypting the King's English?
3
votes
0
answers
66
views
Text to Divisor Class Encoding in Hyperelliptic Curve Cryptography
When trying to implement ElGamal Public Key Encryption using Hyperelliptic Curves, one needs to map the message that will be encrypted to a valid Divisor (in my case in the Mumford representation, ...
2
votes
1
answer
886
views
Encoding a message as points on elliptic curve
I want to encode my plaintexts as points on some given elliptic curve $E$ defined over a finite field $F_q$. Suppose I want to use Koblitz's method. Does the size of the message I want to encode ...
0
votes
0
answers
44
views
Reversing a basic encoder (code in Python) [closed]
Moderator note: this question has moved there at reverseengineering-SE.
I'm trying to reverse the save game of an old game. It use text codes to save the games (anyone remember this?). When decoded ...
0
votes
0
answers
94
views
How to find $z$ when deserializing elliptic curve?
In §2.3.4 of Standards for Efficient Cryptography 1 (SEC 1), the authors define the following step in deserializing elliptic-curve points that were serialized in the format given in §2.3.3 (emphasis ...
1
vote
1
answer
396
views
Reversing an XOR encryption/decryption function
I have a help recommended high-school project that I'm stuck with. To basically explain the problem: I have an encryption function that is used as the decryption function and I need to reverse it to ...
0
votes
1
answer
267
views
How to crack base conversion that uses a secret symbol set?
I've looked at this crypto SE post but it doesn't address the how of my question.
I've been interested in cryptography for some time. I wrote a relatively basic cryptosystem in Python that uses base ...
1
vote
1
answer
2k
views
Verifying Password Using Argon2
I am trying to develop a Rest API using Kotlin/Spring Boot. The JSON request in it, should have a hashed password that was done using Argon2id. Getting the password hashed was pretty straight forward ...
4
votes
2
answers
153
views
Randomized encodings and Indistinguishability obfuscation
I want to understand the difference between randomized encodings and indistinguishability obfuscation (iO).
Are randomized encodings a special type of iO?
1
vote
0
answers
35
views
Is there any known/standard encoding or cipher method that uses a 64-character alphabet from byte 30 (ASCII `0`) to byte 6F (ASCII `o`)?
Is there any known/standard encoding or cipher method that uses a 64-character alphabet from byte 30 (ASCII 0) to byte 6F (ASCII ...
1
vote
1
answer
166
views
Do RSA powers of two modulus always have MSB set to one and so when DER encoded have 0x00 prefix?
Looking at https://crypto.stackexchange.com/a/30616/16548 and all the ways I generate RSA keys (code, SSL) the MSB is always 1 and so when DER encoded has 0x00 ...
1
vote
1
answer
60
views
Encryption using Playfair algorithm
how to encrypt using play fair if "i , j" both are in the plaintext? for example Beijing.
0
votes
0
answers
63
views
How could this scheme work?
When we use a secret sharing scheme we usually want to reconstruct the polynomial function $p(x)\in\mathbb{Z}_q[X]$ with the Lagrange interpolation method and then compute $s=p(0)=a_0$. However, the ...
0
votes
0
answers
38
views
Can we encode with the set of $\{0,1\}$ and its Boolean operations any finite or infinite domain?
Can we encode with the set of $\{0,1\}$ and its Boolean operations any infinite domain that is subset of the real numbers $\mathbb{R}$ or the whole set of real numbers? For example can we encode the ...
2
votes
0
answers
42
views
Cyclical Redundancy Check and bijections [closed]
Let $F_M(n)=\operatorname{CRC32}(M|n)$, where $M$ is an arbitrary length prefix message, $n$ is a 32 bit integer (whether little or big-endian encoded is unimportant) and "|" is simply ...
0
votes
1
answer
1k
views
Using AES.MODE_EAX for AES Encryption [closed]
I am currently attempting to perform AES encryption in Python on a larger size file for simulation purposes. At the moment, I have been trying to use AES.MODE_EAX, as mentioned in the documentation ...
0
votes
3
answers
3k
views
Encryption using ASCII instead of bits and bytes (clarification in the body)
I am new to cryptography and I am trying to understand something. I searched it on the internet, though the question is probably a simple one, couldn't find an answer. So, please don't judge me by ...
0
votes
0
answers
24
views
How does encryption systems encrypt strings? (More clarification in the explanation) [duplicate]
I am new to cryptography and I am trying to understand something. I searched it on the internet, though the question is a simple one, couldn't find an answer. So, please don't judge me by that. Here ...
0
votes
2
answers
2k
views
Doubt regarding converting hex to byte in SHA-256 input
Hash functions such as SHA-256 takes a binary string as input. Now given a hex string when we convert it to a normal text string the computed SHA-256 value would be the same. Herein lies my problem
...
1
vote
2
answers
3k
views
Is XORing a Base64-encoded string secure?
Theoretically, is it secure to first encode a string using Base64 and then XOR it with a random key or are there potential weaknesses that could be exploited?
Obviously this doesn't make any sense in ...
0
votes
1
answer
594
views
Why Entropy is low for Python Fernet Encryption
I am using Fernet encryption from python cryptography.fernet and generated the key as below
...
2
votes
0
answers
209
views
CKKS : Ciphertext extension
I have a CKKS ciphertext containing [a, b, c, d] and I want to get these 4 ciphertexts : [a, a, a, a]; [b, b, b, b]; [c, c, c, c]; [d, d, d, d].
Is there a more efficient way than repeating the ...
-2
votes
0
answers
41
views
AES CBC Encryption Key & Special ASCII characters [duplicate]
Can we add characters like α π Σ µ ...
2
votes
1
answer
640
views
How to encode and decode message into polynomial form on NTRU
This question is based on a previously asked question. How to make a message into a polynomial on NTRU encryption?
I am tasked to implement NTRU with toy parameters such as $N=7$ or $N=11$ and I have ...
0
votes
2
answers
2k
views
How are ECC keys stored?
I am trying to figure out what typical formats and sizes, etc. are, for storing ECC public and private keys.
Some quick research turned up X9.62 (to which I don't have access) and SEC1. But then there ...
2
votes
1
answer
1k
views
Should I calculate SHA-256 hash of a raw bytes of a token or it's hex encoding?
I have a system where I should generate a secret token for a user. The presence of a token is sufficient to grant access to some user-related data.
I am generating a 4096 bit token from a ...
0
votes
0
answers
190
views
Paillier scheme : Encoding floats into integers impact on computations
In Privacy Preserving Processing Over Encrypted Images, I could understand that appropriate encoding of floats into integers (required in Paillier) only incur negligible error in computations.
Any ...
2
votes
1
answer
1k
views
Encode ASN.1 PKCS#8 Private Key with Public Key and attributes
I'm trying to encode an Ed25519 private key as a PEM file based on this document https://www.rfc-editor.org/rfc/rfc8410#page-7 .
I'm using an ASN.1 encoder written in Dart, and I can encode the ...
1
vote
1
answer
302
views
PKCS RSA - Why do we need encoding [duplicate]
In the RSASSA-PKCS-v1_5 signature scheme, the first step is to perform an encoding on the hashed data. (0x00||0x01||PS||0x00||T).
Is this encoding important for security ? What happens if the hash is ...
2
votes
1
answer
100
views
Can you use a dynamic key and data size for KMAC?
I've asked before if some kind of canonical encoding should be used on the input parameters of SHA-3 before it could be used as replacement for HMAC.
However, if I read the current NIST specifications ...
0
votes
2
answers
2k
views
Why use base64 or hexadecimals for ciphertext?
They are asking me to deliver encrypted text in ISO/IEC 8859-1. I have always encoded it to hexadecimal or base64. This text will be sent in a file with plaintext and encrypted text. In my opinion it ...
1
vote
1
answer
200
views
Encrypting serialized data
If I want to encrypt structured data composed of key-value pairs of strings, would it be an advantage to use an encoding that stores keys, values and their lengths, and is padded with random numbers, ...
4
votes
2
answers
370
views
Making a cipher non-malleable using a plaintext transform?
NOTE: By malleable/non-malleable, I mean the ability/or not to change a byte/block of the ciphertext and have it change only that byte/block of the plaintext.
I understand that we use authentication (...
0
votes
2
answers
6k
views
How do I calculate Base64 conversion rate?
Basically I need to have a base64 encoded signature that has to be 96 characters long. However, I do not know what length I need to have the signature at so when I encode it, it can be that exact size....
1
vote
1
answer
99
views
Metrics for Measuring the Distance of Two Numbers in Cryptography
Hamming Distance (HD) has been used to measure the distance of two numbers when they are converted into binary representations. e.g., $Ham(1, 2)=2$ as ...
2
votes
1
answer
202
views
ChaCha matrix - tests for original implementation not passing due to bad counter encoding?
Hello everyone and already thanks for taking your time to read this!
I am currently implementing ChaCha20 (256-bit key) for my bachelor thesis. I know that there are two version of ChaCha out there; ...
3
votes
2
answers
1k
views
XOR cipher with fixed key and known relation among plaintexts
I have three messages, each known to be XOR-encoded, with the same key used for each message of this XOR cipher.
Encoded message 1: $e_1\,=\,00100111010$
Encoded message 2: $e_2\,=\,01001110110$
...
0
votes
0
answers
49
views
How could I verify that a contract was actually sent to me from the client as soon as the contract is received?
with the information provided - what would be the best solution - something like document management program like IBM Filenet ? or trusted timestamping?
If I want to store electronic contracts for ...