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
1 vote
1 answer
37 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 ...
user avatar
  • 147
1 vote
1 answer
49 views

Encryption using Playfair algorithm

how to encrypt using play fair if "i , j" both are in the plaintext? for example Beijing.
user avatar
  • 11
0 votes
0 answers
58 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 ...
user avatar
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 ...
user avatar
2 votes
0 answers
36 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 ...
user avatar
0 votes
1 answer
182 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 ...
user avatar
  • 1
0 votes
3 answers
553 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 ...
user avatar
  • 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 ...
user avatar
  • 3
0 votes
2 answers
701 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 ...
user avatar
  • 141
1 vote
2 answers
559 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 ...
user avatar
0 votes
1 answer
214 views

Why Entropy is low for Python Fernet Encryption

I am using Fernet encryption from python cryptography.fernet and generated the key as below ...
user avatar
2 votes
0 answers
50 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 ...
user avatar
-2 votes
0 answers
35 views

AES CBC Encryption Key & Special ASCII characters [duplicate]

Can we add characters like α π Σ µ ...
user avatar
  • 3
2 votes
1 answer
230 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 ...
user avatar
  • 227
0 votes
2 answers
512 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 ...
user avatar
  • 4,659
1 vote
1 answer
460 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 ...
user avatar
  • 13
0 votes
0 answers
86 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 ...
user avatar
  • 65
1 vote
1 answer
384 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 ...
user avatar
1 vote
1 answer
102 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 ...
user avatar
  • 47
2 votes
1 answer
41 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 ...
user avatar
  • 84.5k
0 votes
2 answers
574 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 ...
user avatar
1 vote
1 answer
183 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, ...
user avatar
4 votes
2 answers
285 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 (...
user avatar
  • 1,423
0 votes
2 answers
160 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....
user avatar
1 vote
1 answer
73 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 ...
user avatar
  • 13
1 vote
1 answer
89 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; ...
user avatar
  • 33
3 votes
2 answers
862 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$ ...
user avatar
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 ...
user avatar
  • 27
5 votes
1 answer
2k 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. ...
user avatar
1 vote
0 answers
65 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 ...
user avatar
2 votes
1 answer
274 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 ...
user avatar
1 vote
1 answer
120 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?
user avatar
  • 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 ...
user avatar
  • 84.5k
1 vote
2 answers
378 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 ...
user avatar
  • 593
1 vote
2 answers
439 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: ...
user avatar
  • 1,212
0 votes
0 answers
244 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 ...
user avatar
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: ...
user avatar
  • 125
6 votes
1 answer
191 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 ...
user avatar
  • 171
1 vote
0 answers
195 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 ...
user avatar
  • 11
1 vote
0 answers
64 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)$. ...
user avatar
0 votes
2 answers
152 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 ...
user avatar
1 vote
2 answers
228 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-...
user avatar
  • 197
0 votes
1 answer
242 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}$ (...
user avatar
2 votes
1 answer
234 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 ...
user avatar
  • 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 ...
user avatar
3 votes
1 answer
741 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 ...
user avatar
2 votes
1 answer
853 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: ...
user avatar
  • 155
3 votes
2 answers
1k views

Decrypt Base64 Encoded Monoalphabetic Cipher

I'm attempting to decrypt a body of ciphertext which has been encrypted using a monoalphabetic cipher. The trouble I'm having is that the plaintext was base64 encoded before being encrypted. In this ...
user avatar
  • 33
-1 votes
1 answer
343 views

finding encoding based collision

For example, If I enter as a sample "hello world" in English, then the hashing protocol by encoding the text to binary strings makes the hash. What if I find a word in other languages like Hindi or ...
user avatar
  • 1,854
1 vote
3 answers
1k views

Base64 encoding of strings

I have read everywhere that base64 encoding of unique binary/hex values results in unique output. The following two string encode to virtually the same output. ...
user avatar
  • 21