diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-11-13 23:51:06 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-11-13 23:51:06 +0200 |
| commit | 60507757b61e36413d40060262b3e460053f779b (patch) | |
| tree | 1add70b9899155596ebfe10f095a639a758067fc /src/content/blogs/the-search-for-the-perfect-ed25519-key.md | |
| parent | e909da9e8410c018e1d7d3e5341d877ed186077c (diff) | |
Some blog changes
Diffstat (limited to 'src/content/blogs/the-search-for-the-perfect-ed25519-key.md')
| -rw-r--r-- | src/content/blogs/the-search-for-the-perfect-ed25519-key.md | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/content/blogs/the-search-for-the-perfect-ed25519-key.md b/src/content/blogs/the-search-for-the-perfect-ed25519-key.md new file mode 100644 index 0000000..cb47772 --- /dev/null +++ b/src/content/blogs/the-search-for-the-perfect-ed25519-key.md @@ -0,0 +1,45 @@ +--- +title: The search for the perfect ed25519 key +description: Here's how you can embed your name in an SSH key +date: 2024-12-11 +--- + +# The search for the perfect ed25519 key + +Todo write intro to catch attention + +### Why care about an ed25519 key? + +Ed25519 is a cryptographic algorithm for generating +a pair of keys, a public one that can be shared with anyone +and a private one that is kept as a secret. + +### The ssh public key format + +If you have ever accessed a remote server it was most likely by +ssh-ing into it. +You have also most likely had to copy paste something similar to this: + +``` +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBSSj+yfJLWEb+Df4r4603TOFAUBREYS43qQB+c9i9UW +``` + +Let's break it down + +- The first part `ssh-ed25519` is the algorithm type, other common algorithms are `ssh-rsa` and `ssh-ecdsa` +- The second part is a base64-encoded binary format consiting of + - the length of the algorithm string, for ed25519 it's always 11 (4 bytes long) + - the algorithm type, for ed25519 it's always `ssh-ed25519` in binary (11 bytes long) + - the length of the key, 32 bytes for ed25519 (4 bytes long) + - the actual ed25519 key (32 bytes long) + +### Embedding a word in base64 + +Base64 is a widely used format for writing binary in a compact and human readable way, +it uses A-Z, a-z, 0-9, '/' and '+' adding up to 64 unique characters. + +It's possible to choose specific bytes in a way that when encoding it with base64 +it will form a word. + +For example, to encode "Kyren" in base64, we can use the following bytes +`00101011 00101010 01001110` or in hex `2b 2a de` |
