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
0 answers
23 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?
mini minions's user avatar
2 votes
1 answer
89 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, ...
DannyNiu's user avatar
  • 9,001
1 vote
1 answer
46 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 ...
Martin Benes's user avatar
0 votes
1 answer
35 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: ...
Zhu's user avatar
  • 1
1 vote
1 answer
89 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 ...
DJ in Colorado's user avatar
4 votes
1 answer
785 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?
Paul Uszak's user avatar
  • 15.2k
3 votes
0 answers
59 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, ...
PanosDgs's user avatar
2 votes
1 answer
578 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 ...
midmotor's user avatar
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 ...
Roberto's user avatar
0 votes
0 answers
88 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 ...
JamesTheAwesomeDude's user avatar
1 vote
1 answer
172 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 ...
Roberto's user avatar
  • 13
0 votes
1 answer
195 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 ...
SNN's user avatar
  • 1
1 vote
1 answer
825 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 ...
hell_storm2004's user avatar
4 votes
2 answers
126 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?
BlackHat18's user avatar
1 vote
0 answers
33 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 ...
GPHemsley's user avatar
  • 111
1 vote
1 answer
112 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 ...
Veksi's user avatar
  • 147
1 vote
1 answer
58 views

Encryption using Playfair algorithm

how to encrypt using play fair if "i , j" both are in the plaintext? for example Beijing.
aaaa's user avatar
  • 11
0 votes
0 answers
62 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 ...
Hunger Learn's user avatar
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 ...
Hunger Learn's user avatar
2 votes
0 answers
41 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 ...
user3084125's user avatar
0 votes
1 answer
783 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 ...
sashok's user avatar
  • 1
0 votes
3 answers
2k 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 ...
Wolf's 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 ...
Wolf's user avatar
  • 3
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 ...
J.Doe's user avatar
  • 151
1 vote
2 answers
2k 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 ...
jnhecate's user avatar
0 votes
1 answer
545 views

Why Entropy is low for Python Fernet Encryption

I am using Fernet encryption from python cryptography.fernet and generated the key as below ...
user1661988's user avatar
2 votes
0 answers
176 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 ...
Matthieu Brabant's user avatar
-2 votes
0 answers
39 views

AES CBC Encryption Key & Special ASCII characters [duplicate]

Can we add characters like α π Σ µ ...
Archi2's user avatar
  • 3
2 votes
1 answer
516 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 ...
evernal's user avatar
  • 237
0 votes
2 answers
1k 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 ...
Elias's user avatar
  • 4,883
1 vote
1 answer
943 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 ...
Aerol's user avatar
  • 13
0 votes
0 answers
144 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 ...
witdev's user avatar
  • 75
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 ...
Pedro Girardi's user avatar
1 vote
1 answer
240 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 ...
cmdEvo's user avatar
  • 47
2 votes
1 answer
77 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 ...
Maarten Bodewes's user avatar
  • 91.8k
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 ...
Felipe Rodriguez Fonte's user avatar
1 vote
1 answer
195 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, ...
Hashi Oki's user avatar
  • 115
4 votes
2 answers
339 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 (...
Modal Nest's user avatar
  • 1,443
0 votes
2 answers
2k 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....
John Chen's user avatar
1 vote
1 answer
88 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 ...
Paxton's user avatar
  • 13
2 votes
1 answer
175 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; ...
ekzyis's user avatar
  • 43
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$ ...
XOR_Help's user avatar
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 ...
Brooney's user avatar
  • 27
5 votes
1 answer
5k 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. ...
Dogus Ural's user avatar
1 vote
0 answers
85 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 ...
Artem Glukhov's user avatar
2 votes
1 answer
384 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 ...
user173379's user avatar
1 vote
1 answer
150 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?
CodingGuy's user avatar
  • 111
7 votes
2 answers
3k 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 ...
Maarten Bodewes's user avatar
  • 91.8k
1 vote
2 answers
677 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 ...
SamG101's user avatar
  • 613
1 vote
2 answers
535 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: ...
Woodstock's user avatar
  • 1,374