> with the help of a key
So, where is the key?
Maybe this differentiation is not popular or well accepted, but it was surely part of my cryptography curriculum and the following exam. I'd rather believe my prof than strangers on the internet.
A bad substitution cipher is still a cipher. Just one you shouldn't use for anything important.
Base64 is an encoding. It's an algorithm, no attempt at secrecy, thus not a cipher.
You'd do better debating this with a real life friend over a pint, rather than wasting your time trying to argue with multiple people here.
> "I belong to a secret group of panda bear hunters! Eat a meaty flesh chunk...."
For anyone wondering..
https://gist.github.com/DavidBuchanan314/07da147445a90f7a049...
Since an arbitrarily tall stack of combining characters still counts as one grapheme cluster, if some application limits string length by counting grapheme clusters then you can stuff an unlimited amount of data in there, with "only" 2x overhead in the byte representation.
Unfortunately HN filters some of the codepoints so I can't demonstrate here. Since I chose "A" as the base character which the diacritics are stacked on, it has a similar aesthetic to the SCREAM cipher although a little more zalgo-y.
Also I'm reminded that the unicode normalization annex suggests that legitimate grapheme clusters will be 31 code points or less. "The value of 30 is chosen to be significantly beyond what is required for any linguistic or technical usage."
[1] - https://github.com/qntm/base2048
r̊e̝q̝ůěs̔t͞ p̊e̝a͞c̍e̊ t̠a̗lks
#lang racket/base
(require net/base64
threading)
(define FIRST-INVISIBLE-CHAR 917760)
(define (invis-encode str)
(list->string
(for/list ([c (in-list (string->list str))]
#:do [(define cnum (char->integer c))]
#:when (<= cnum 127))
(integer->char (+ cnum FIRST-INVISIBLE-CHAR)))))
(define (invis-decode str)
(list->string
(for/list ([c (in-list (string->list str))]
#:do [(define plaintxt-c (- (char->integer c) FIRST-INVISIBLE-CHAR))]
#:when (> plaintxt-c 0))
(integer->char plaintxt-c))))
(define (hide secret plain)
(~> (string->bytes/utf-8 secret)
(base64-encode #"") ; use #"" vs #"\r\n" to prevent line-wrapping
(bytes->string/utf-8)
(invis-encode)
(string-append plain _)))
(define (unhide ciphertext)
(~> (invis-decode ciphertext)
(string->bytes/utf-8)
(base64-decode)
(bytes->string/utf-8)))
(module+ test
(require rackunit)
(define secret "this is a s3cret message. ssh")
(define plaintext "Hey you, nothing to see here.")
(define to-share (hide secret plaintext))
(check-equal? (string-length to-share) 69) ; count of bytes
(check-equal? (string-grapheme-count to-share) 29) ; 29 actually-visible graphemes
(check-equal? secret (unhide to-share)))Thank you for this important contribution to cryptography!
> Immediately thought of Moby, infact a quick search for this title... coincidental, but I would mention it in the page if I were you.
and noted that it had "preserved punctuation and capitalization from the ciphertext". The actual plaintext should be:
> Immediately thought of XKCD, infact a quick search for this title gives me XKCD, it could be coincidental, but I would mention it in the page if I were you.
I've hit my free usage limit so can't currently prompt it further about its mistake.
[1] https://chatgpt.com/share/68cf17a6-8478-8011-a44e-64d43ad8a4...
https://chatgpt.com/share/68cf3b9f-decc-8007-8a5d-cc7b583d0e...
I’m currently building an implementation with fractional rotation. Of course I will post a Show HN when it’s ready.
But Swedish "Å" is just stupidity "O", because they started pronouncing "O" as "U" and "U" as "Y".
-- Can you pronounce these screams?
CIPHER, UNCIPHER = str.maketrans(CIPHER), str.maketrans(UNCIPHER)
print(s := 'STREAM CIPHER'.translate(CIPHER))
print(s.translate(UNCIPHER)) transform=s=>[...s.toUpperCase()].map(s=>(l="BÁGẲLẬQǞVÀCĂHẴMẦRȦWẢDẮIǍNẨSǠXȂEẶJÂOẪTẠYĀFẰKẤPÄUȀZĄ")[l.indexOf(s)^1]||s).join``
DonHopkins•4mo ago
codeulike•4mo ago