47
votes
How to find modulus from a RSA public key?
I wanted to help break down exactly what you're seeing.
If you take your base64 string:
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/...
32
votes
How to find modulus from a RSA public key?
In practice, one can use openssl to extract the information:
...
31
votes
Accepted
Can I remove newlines in a public key?
I'm assuming you mean a base 64 encoded key file, since removing the newlines from a binary file would obviously break things.
The RSA standards (e.g. RFC 2459) only define a binary representation for ...
30
votes
Accepted
How to find the encoding of an RSA public key?
The first step is to check how much data we have. That gives an idea of the size of the public modulus: although it is possible to compress an RSA public modulus $N$ to less bits than its bitlength $\...
28
votes
Accepted
How to find modulus from a RSA public key?
RSA key formats are defined in at least RFC 3447 and RFC 5280. The format is based on ASN.1 and includes more than just the raw modulus and exponent.
If you decode the base 64 encoded ASN.1, you will ...
24
votes
Does keyless encryption exist?
Clarification
I'm wondering whether there exists an encoding/hashing/encryption scheme whereby the original string can always be derived in its entirety given the entire encoded/hashed/encrypted ...
23
votes
Encoding vs. Compression vs. Encryption
OK, there seems to be some confusion with regards to terminology, so let's try to clean that up. I'll try and define things myself, but also provide the more formal Wikipedia definitions.
Encryption. ...
15
votes
Accepted
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 ...
14
votes
Accepted
Using 32 hexadecimal digits vs ASCII equivalent 16-character password
They are both equal.
Passphrase security is based on the amount of entropy that the passphrase contains. In your case, both of your pieces of data are only different in the encoding. The actual ...
14
votes
Does keyless encryption exist?
Secret Sharing may be another option to consider. It allows you to take a value, break it up into arbitrarily many pieces, and possession of a subset of these pieces, not the entire set, makes ...
13
votes
Accepted
Why do we use hex output for hash functions?
Hexadecimal is traditional -- by this, I mean that there first were command-line tools that used hexadecimal for output, then other people using the hash functions found it fit to stick to hexadecimal,...
11
votes
Accepted
How to perform frequency analysis of a substitution cipher using a Base64 alphabet
I'll assume that the plaintext consists entirely of capital ASCII letters as in the example. This implies the high 3 bits of each byte of plaintext are 010.
It is ...
11
votes
Algorithms for Cyrillic encryption
Modern cryptographic algorithms are specified in terms of bytes or even bits, not characters.
Whether the data you encrypt happens to represent latin or cyrillic letters or pictures or audio data or ...
10
votes
Would it be better to split a file and then encrypt, or vice versa?
Either could be implemented securely, but if you encrypt first and split afterwards, you can use standard tools and get everything right more easily. If you used the opposite order, you would have ...
9
votes
Is there an existing cryptography algorithm / method that both encrypts AND compresses text?
The way this is usually done is to use a separate compression algorithm, then encrypt the compressed (shorter) message.
However, compression has some disadvantages and nowadays its use is discouraged....
9
votes
Encryption-then-encode or encode-then-encryption?
With some modes you can encode then encrypt, specifically stream cipher modes (CTR, OFB). Bit errors during transmission translate to identical bit errors in the encoded plaintext, and error ...
9
votes
Does keyless encryption exist?
OAEP - Optimal Asymmetric Encryption Padding may be what you want.
In RSA public-key encryption system, in order to prevent partial decryption, OAEP padding is used. In essence, it's a Feistel ...
8
votes
Do I need to worry about timing attacks in Base64 encoding/decoding of private keys?
Yes, kind of. The encoding does depend on the individual bits so there could very well be timing differences. Note that the differences would be pretty small; encoding a byte is likely much faster ...
8
votes
Accepted
Does character encoding change entropy?
Technically these two strings have the same entropy I believe:
We cannot tell how much entropy is in a string by looking at it, as it depends on how it is generated and if the values cannot be ...
7
votes
Accepted
Are specially designed fonts sometimes used in cryptography?
Is this something that exists and could be plausible?
Yes, things like that already exist and have even been used by well-known serial killers!
(So much for creating a dramatic intro – lol)
...
7
votes
What are I2OSP & OS2IP in RSA PKCS#1?
I2OSP and OS2IP mean Integer to Octet Stream Primitive and Octet Stream to Integer Primitive. There is an often used play on words here: "two" (2) has almost the same pronunciation as "...
7
votes
Accepted
Doubt regarding converting hex to byte in SHA-256 input
Let us consider a simple string in Hex: 2E Its SHA value is:
cdb4ee2aea69cc6a83331bbe96dc2caa9a299d21329efb0336fc02a82e1839a8
...
6
votes
Accepted
Decoding base64 encoded message with a key
That's a simple substitution cipher. Base 64 uses the following alphabet A-Za-z0-9+/. Here A encodes ...
6
votes
Encoding a message to a point of curve y^2=x^3+7 and Bitcoin Core
In ECDSA, the message is never encoded as a point in the elliptic curve. Signing in ECDSA loosely works like this:
$$
\begin{align*}
k &= \text{random}(0, n) \\
(x, \_) &= k \cdot G \\
r &...
6
votes
Accepted
SHA-1 requires utf-8 and reordering of bytes
Text is supposed to be utf-8 encoded / one character should be 8 bit long. this makes sense, since the same text should always return the same hash, but I couldn't find anything about it in the RFC. ...
6
votes
Does keyless encryption exist?
A simple way to achieve this with common algorithms would be to do the following:
Choose a random key (key)
Encrypt the data using the random key (encrData)
Hash the encrypted data (encrHash)
Xor ...
6
votes
Accepted
Is there a consensus on what text encoding to use when hashing a string?
Hashing is done on binary, not text strings. It is the job of the character encoding to say what binary representation a string will have. After you represent the text using a particular encoding, ...
6
votes
Encrypt-then-MAC with base 64
Generally you would use encrypt-then-MAC before encoding. There is no need to process the expanded ciphertext before encoding, and you may be able to send the
message both in binary and ASCII-armored ...
6
votes
Accepted
Converting raw ECC private key into ASN.1 DER encoded key
ASN.1 is a way of defining structures for data, and DER is a binary encoding of those structures. But they aren't describing any structures by themselves. Saying that something needs to be ASN.1 / DER ...
5
votes
Base64 for a hash algorithm
If you had an algorithm that used a Base64 conversion as a part of its processing, that would not be considered grounds for disqualifying it as a hash function (be it a cryptographical or ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
encoding × 118encryption × 35
hash × 14
rsa × 11
public-key × 9
elliptic-curves × 9
signature × 6
keys × 6
xor × 6
entropy × 5
substitution-cipher × 5
algorithm-design × 4
homomorphic-encryption × 4
sha-256 × 4
stream-cipher × 4
key-size × 4
password-hashing × 4
compression × 4
aes × 3
md5 × 3
decryption × 3
file-encryption × 3
coding-theory × 3
asn.1 × 3
cryptanalysis × 2