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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
54 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
84 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
28 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 ...
  • 111
1 vote
1 answer
44 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 ...
  • 147
1 vote
1 answer
51 views

Encryption using Playfair algorithm

how to encrypt using play fair if "i , j" both are in the plaintext? for example Beijing.
  • 11
0 votes
0 answers
60 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
37 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
39 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
242 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 ...
  • 1
0 votes
3 answers
837 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 ...
  • 3
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 ...
  • 3
0 votes
2 answers
997 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 ...
  • 141
1 vote
2 answers
988 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
301 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
67 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
35 views

AES CBC Encryption Key & Special ASCII characters [duplicate]

Can we add characters like α π Σ µ ...
  • 3
2 votes
1 answer
261 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 ...
  • 237
0 votes
2 answers
657 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 ...
  • 4,731
1 vote
1 answer
540 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 ...
  • 13
0 votes
0 answers
97 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 ...
  • 65
1 vote
1 answer
545 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
138 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 ...
  • 47
2 votes
1 answer
48 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 ...
  • 86.5k
0 votes
2 answers
776 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
185 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
300 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 (...
  • 1,423
0 votes
2 answers
213 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
75 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 ...
  • 13
1 vote
1 answer
106 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; ...
  • 33
3 votes
2 answers
946 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
47 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 ...
  • 27
5 votes
1 answer
3k views

Converting raw ECC private key into ASN.1 DER encoded key

I created a random integer array of 32 bytes to use as my private key for secp256k1 curve. ...
1 vote
0 answers
68 views

keyboard communication protocol? [closed]

I'm analyzing the transmitted data from the apple Smart Keyboard to the iPad, and I have troubles arriving to a conclusion: When I press a key, the keyboard transmit two blocks of data: the ...
2 votes
1 answer
297 views

XOR of 16-bytes variables gives a result of size not equal to 16

I'm trying to write a XOR code for implementing CBC mode of operation from scratch but i seem to have some problem.The function takes two byte variables of 16bytes and the expected output should be ...
1 vote
1 answer
125 views

Proof that Niederreiter Cryptosystem is correct

I read about Niederreiter Cryptosystem. I understood the Key Generator, encryption and decryption of the cryptosystem, but if I want to prove that is a correct cryptosystem, what should I do?
  • 111
7 votes
2 answers
2k views

How to create an EC point from a plaintext message for encryption

It seems that ElGamal encryption is also possible for Elliptic Curve cryptography. However, that requires the user to convert the message to a point on the curve. What strategies are there to derive a ...
  • 86.5k
1 vote
2 answers
451 views

SHA3 the Left & Right Encode Functions

In this paper (Section 2.3.1, Pg.5), I came across the left_encode and right_encode functions, and I have some questions about ...
  • 593
1 vote
2 answers
473 views

Does character encoding change entropy?

This is a question I've been wondering for a while. Technically these two strings have the same entropy I believe: ...
  • 1,284
0 votes
0 answers
266 views

Encoding function for ISO 9796-2

I try to reproduce the analysis conducted in this presentation by R. Lifchitz. Namely, data signed by an 1024-bit key $n$ (Rabin scheme) and following ISO/IEC 9796-2. From what I understand, for a ...
2 votes
1 answer
1k views

"hex" vs. "base64" encoding when enciphering

Examining different implementations of encryption / decryption with cipher on Node.js, I paid attention that some implementations use hex encoding: ...
  • 125
6 votes
1 answer
197 views

Hash multiset to point on elliptic curve where $A = 0$

I want to hash a multiset to a point on the elliptic curve $y^2 = x^3 + 3$ over a finite field of some 254-bit prime order, where $P = 3 \pmod 4$. Moreover, I want this hash to be incremental, in that ...
  • 171
1 vote
0 answers
241 views

How to encode and decode 14-character codes with 20 specifically allowed characters as integers within the smallest range possible? [closed]

I am attempting to do phase space analysis on Coke Reward Codes that are 14 characters long and composed of only the following 20 characters: Letters: B F H J K L M N P R T V W X Numbers: 4 5 6 7 9 ...
  • 11
1 vote
0 answers
66 views

Constructing Low-Density Parity-Check Codes of length $n$ and minimum distance = $\delta n$ over $GF(q)$? [closed]

I am looking for a way to construct an LDPC (Low-Density Parity-Check) Code $C$ of length $n$ and minimum distance $d_C$ that scales linearly to $n$, meaning $d_C = \delta n$ for $\delta \in (0,1)$. ...
0 votes
2 answers
170 views

What is the opposite of embed?

We often embed items from one space into another space, e.g. embedding plaintext items from $\{0, 1\}^m$ into some ring $R_q/\langle x^N + 1 \rangle$ for RingLWE. What is the inverse of this action ...
1 vote
2 answers
237 views

Can Reed Solomon parity blocks be used as an all-or-nothing transform?

Consider the following scheme: Perform an (N,N) Reed-Solomon encoding (i.e. N data blocks, N parity blocks) Drop the N data blocks and keep only the N parity blocks. Are these N parity blocks an all-...
  • 197
0 votes
1 answer
266 views

Does encoding a secret affect security?

My question is simple. I have a secret that is generated with a 10 byte long pseudorandom generator library (e.g. Java's SecureRandom), that in theory provides a security equivalent to $2^{40}$ (...
2 votes
1 answer
247 views

Is there any identification for common encoding/encryption?

I come across lots of tokens which might be simply encoded and not random, but I don't know any way to identity if they are encoded or random, how to find is there any cheatsheet for the same. For ...
  • 21
2 votes
1 answer
3k views

How can you derive a P-256 public key from the X and Y points

Deriving a secp256k1 public key is also possible. For whatever reason, I'm only being provided X and Y, not the public portion. I just need to get the binary representation of the public key given ...
3 votes
1 answer
823 views

Restoring a point on an elliptic curve

I received a representation of a point on an elliptic curve $GF(2^m)$ (with curve coefficient A, B) in specific format and some description how to decode it but not all is clear to me. I would be ...
2 votes
1 answer
918 views

What is the encoding protocol for passphrase protected RSA private keys?

What is the protocol used to encode an RSA key protected with a passphrase? If I generate an RSA key with ssh-keygen -t rsa -b 4096 and do: ...
  • 155