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
31
votes
1answer
36k views

Can I remove newlines in a public key?

Can I remove new lines from the RSA public key file to get a one line string? So the question is if the key looks like this AAA BBB CCC or ...
25
votes
4answers
68k views

How to find modulus from a RSA public key?

I am studying the RSA cryptosystem. The public key consists of $(n, e)$, the modulus (product of two large primes), and the encryption exponent. I want to separate the modulus $n$ and exponent $e$. A ...
20
votes
7answers
6k views

Does keyless encryption exist?

Does there exist an encoding/hashing/encryption scheme whereby the original string can always be derived in its entirety given the entire encoded/hashed/encrypted string, and nothing else (no key/...
14
votes
1answer
4k views

How to find the encoding of an RSA public key?

What practical methods is there to reconstruct an RSA public key in unknown format? As an illustration, in a database I find this (which doesn't look like ASN to me): ...
11
votes
2answers
465 views

Do I need to worry about timing attacks in Base64 encoding/decoding of private keys?

Do I need to worry about timing attacks in Base64 encoding/decoding of private keys? This is a common operation (ex. PEM keys) and is variable time in typical implementations.
9
votes
1answer
7k views

Encoding vs. Compression vs. Encryption

In what ways does encryption differ from proprietary/secret compression schemes and codecs?
7
votes
3answers
1k views

Encryption-then-encode or encode-then-encryption?

I have this question in which I m struggling. I have read in many sites about encrypt-then-mac etc. If the confidentiality for transmission is needed, discuss the feature for the order of encryption ...
6
votes
3answers
5k views

How to perform frequency analysis of a substitution cipher using a Base64 alphabet

Let's imagine a cipher that works like the following: Plaintext is encoded to Base64. The characters in the encoded plaintext are substituted with a randomly shuffled character set(A-z, 0-9, -, _, =)....
6
votes
3answers
2k views

How do I test my encryption? (absolute amateur)

I am a hobby programmer with a background in biology and have developed an encryption program based on DNA. I tried to make it hard to crack, but it's essentially a substitution cipher and uses the ...
5
votes
2answers
2k views

Would it be better to split a file and then encrypt, or vice versa?

Assuming that you are paranoid before storing your file (distributed across a shared location), which will be the best case scenario: splitting the file first and then encrypting or encrypting first ...
5
votes
2answers
375 views

Is there a practical security difference between OTP with letters and OTP with numbers?

Is there a practical security difference between “OTP with letters” and “OTP with numbers”? If, for example, I encrypt a letter message using Tabula Recta with a random letter key, I would get: <...
5
votes
2answers
182 views

Steganography in speech by adding extra “filler” syllables [closed]

PREAMBLE About 20 years ago, when reading a novel (set in late 1800) by some classic Russian writer I came across very curious example of steganography. The two main characters were peasants who got ...
4
votes
3answers
3k views

Using 32 hexadecimal digits vs ASCII equivalent 16-character password

Assume I'm using a cryptographic algorithm to pseudo-randomly generate a string that is specified to be 16 characters long. The string will be used as a passphrase when encrypting a file. So, for ...
4
votes
4answers
2k 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
3answers
365 views

Encrypt-then-MAC with base64

I've a doubt about the Encrypt-then-MAC approach when using HMAC-SHA256 with AES128 in CBC mode, as seen in https://en.wikipedia.org/wiki/Authenticated_encryption. I need to encode the resulting ...
4
votes
1answer
2k views

What are I2OSP & OS2IP in RSA PKCS#1?

I started working with RSA two weeks ago. But I couldn't really understand how exactly I2OSP & OS2IP are working. I am using some open source for signature verification through RSA PSS algorithm. ...
4
votes
1answer
389 views

What do the last chunks of the output string of Scrypt contain?

When you use scrypt to hash a string, it will generate something like: ...
4
votes
1answer
2k views

Koblitz encoding a message to a point, what is the “associated auxiliary base parameter”?

I am looking at the Koblitz method for encoding a message as an elliptic curve point. The first step given in the paper I'm reading is: "Choose an elliptic curve and its associated auxiliary base ...
4
votes
1answer
312 views

How secure is this use of Ziv-Lempel encoding?

I'm reading patent application US 20120278897 A1 — “System and method of sort-order preserving tokenization”. Near the bottom they describe their token generation algorithm, which basically involves ...
3
votes
4answers
5k views

Is there an existing cryptography algorithm / method that both encrypts AND compresses text?

So I'm trying to find a method of encryption that not only obfuscates text, but also compresses the result. For example, if I encrypted ninechars, the ideal result ...
3
votes
2answers
289 views

Encoding Public Keys

We would like to encode ECDSA Public Key specifically keys generated using the ed25519 for storage . What is the best and less error prone method , for now we think about using Hex strings or Base64 ...
3
votes
1answer
167 views

How can you tell the type of encoding being used?

$2y$05$68LWs2pXiEvhVTacJ9PX/elfa1zq9jCBlv61hEw1pCvAHlaJyeMwW This hash value is 70 characters long. How can I tell what type of encoding was used to generate it? ...
3
votes
1answer
8k views

Decoding base64 encoded message with a key

I am pentesting a database that where I found data which was base64 encoded. I tried the usual method of decoding base64, which didn't work. Later, I found in ...
3
votes
2answers
445 views

Can a Deterministic Signature Algorithm be paired with a Probabilistic Encoding Method?

I'm working with a C++ library and I’m currently investigating the changes needed to accommodate Deterministic DSA and ECDSA Signatures (RFC 6979). While the RFC 6979 changes are specific, I'm trying ...
3
votes
2answers
1k views

Solving Quadratic equations in Galois Field (2^163)

Hello I am working on implementing a message to elliptic curve point mapping hardware circuit I have done some research and found out the koblitz mapping method: I will be using a field of binary ...
3
votes
2answers
293 views

Is there an encryption algorithm that only adds minimal (if any) size compared to the size of the unencrypted data?

We are working on a project in which we will need to encode and encrypt 1 - 1.3 kb worth of data at a time. We need the result of each piece of data to be the same size it was before, or be smaller, ...
3
votes
1answer
542 views

Numeric base conversion in cryptosystems?

I have been wondering if numeric base conversion has ever found an application in cryptography. By base conversion, an example that is probably familiar is Base64 encoding. This is an example of ...
3
votes
0answers
47 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 ...
2
votes
1answer
396 views

SHA-1 requires utf-8 and reordering of bytes

Today I implemented SHA-1 in JavaScript. While doing so I stumbled upon two requirements which are not mentioned in the RFC-3174. Text is supposed to be utf-8 encoded / one character should be 8 bit ...
2
votes
2answers
253 views

Scalar product of vectors over polynomial rings

I have been studying about homomorphic encryption (HE) lately, and I am trying to perform simple computations over encrypted data. Specifically, I am interested in the scalar product between two ...
2
votes
1answer
269 views

RSA: Given $n$ and $\varphi(n)$, find $e$ such that $e=d$

Say we have chosen $n=pq$, with $p=89,q=97 \implies n=8633$ and $\varphi(n)=88\times96=8448$. Also, if we want the encoding ($e$) and decoding ($d$) exponents to be equal, we need $$(e,8448)=1 \: \: \...
2
votes
1answer
193 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
2answers
403 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 ...
2
votes
1answer
89 views

Size of bitwise OR between vectors represented as polynomials

I am using polynomials to represent bit vectors, such that the value of the d-th coefficient is $1$ if the d-th bit in the vector is $1$, and $0$ otherwise. For example, the vector $A = [1, 1, 0, 1, 0]...
2
votes
4answers
1k views

Is this an effective obfuscation technique?

Long ago I created a simple program which obfuscated a file by taking the first byte, then XORing it with the second, taking the (original) 2nd byte and X-ORing with the 3rd, etc, down the line. The ...
2
votes
1answer
73 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 ...
2
votes
1answer
325 views

Why is garbled circuit a randomized encoding?

In Garbled Circuit, a circuit C is encoded to C' and input x is encoded to x' such that only C(x) can be computed given C' and x'. Randomized encoding of a function f is another randomized function f'...
2
votes
1answer
339 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: ...
2
votes
1answer
454 views

why does TTLV encoding in KMIP require padding?

I study the KMIP in OASIS standard, I need some help. Integers, Enumerations, and Intervals in KMIP length shall be padded with four bytes. the reason for padding in kmip is need to match the right ...
2
votes
1answer
2k views

How to decrypt a substitution cipher using a Base64 alphabet [duplicate]

Let us consider a cipher that works like the following: Plaintext is encoded to Base64. The characters in the encoded plaintext are substituted with a randomly shuffled character set (a-z, 0-9, A-Z, /...
2
votes
0answers
103 views

Infer encoding mechanism from $n$-grams distance?

I have a series of obfuscated strings which across the set of strings have regions of high variance and regions of low variance – implying some encoding mechanism as opposed to an encryption procedure ...
1
vote
3answers
620 views

Algorithms for Cyrillic encryption

I am working on a cryptography application which is to be used in my country. I tried looking up to see if there are any algorithms that support the Cyrillic alphabet, but I found none. Do you know of ...
1
vote
3answers
313 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. ...
1
vote
3answers
466 views

RSA - How to change the encrypted numerical result into text?

I'm aware of the way that the original plain text is converted into a number by taking the ascii numbers of the byte array of the plain text, but doing things the other way around doesn't seem to work....
1
vote
3answers
179 views

Is there a consensus on what text encoding to use when hashing a string?

Let's suppose we are hashing a string input from the user via keyboard. A string can be interpreted in many different text encodings (ANSI, UTF-8, UTF-16 and many others). Based on what encoding is ...
1
vote
2answers
112 views

Clarification on Size of an Encryption Key

Given a key with a certain key size (e.g., 64bits). Would I be correct to interpret this as 8 characters (since each character would be 8 bits under ASCII encoding)? Because the ASCII scheme is ...
1
vote
1answer
142 views

Encoding a message to a point of curve y^2=x^3+7 and Bitcoin Core

Where should I look at in Bitcoin Core source code to figure out how the signature process trasform a message in a curve point? To sign a transaction (message) in Bitcoin system, you need to encode ...
1
vote
1answer
296 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 ...
1
vote
1answer
168 views

Huffman coding is a prefix code, proof [closed]

How would you prove that Huffman coding $C$ is a prefix code, i.e $$\forall x,y \in C,\ \forall z \in \lbrace 0,1\rbrace^*,\ x\not=y||z$$ Using induction according to the number of items to code? ...
1
vote
1answer
2k views

How to determine the RSA Private key size from the Public.key file?

Question: How to determine the RSA Private key size from the Public.key file? Just roughly, how big it could be? ...