11 ms·
Scream cipher
- zahlman 1y agoIt's not necessary to write the ciphering logic. CIPHER, UNCIPHER = str.maketrans(CIPHER), str.maketrans(UNCIPHER) print(s := 'STREAM CIPHER'.translate(CIPHER)) print(s.translate(UNCIPHER))
- SethMLarson 1y agoNICE!!
- zahlman 1y agoIt's truly an honour to have been able to teach the PSF's Security Developer-in-Residence something about the implementation of a simple substitution cipher in Python. ;) (In all seriousness, thanks for all your excellent work. The many projects you help out with — and advocate for — in the Python ecosystem, including CPython itself, are all far better off for it.)
- SethMLarson 1y ago<3 Thanks for the kind words!! :)
- DonHopkins 1y agoẰǍȦǠẠ ÄẪǠẠ
- codeulike 1y agoẰậaẳẳặắ
- blueflow 1y ago... in the same sense that ROT13 or base64 would be a cipher.
- andy99 1y agoYes https://en.m.wikipedia.org/wiki/Substitution_cipher https://en.m.wikipedia.org/wiki/Substitution_cipher
- blueflow 1y agoFirst sentence: > with the help of a key So, where is the key?
- shakna 1y agoThe key is the data table, representing which each character encodes to or from.
- bradrn 1y agoIn the code in this article, the key is the mapping stored in ‘CIPHER’.
- JdeBP 1y agoFirst, second, and third statements of the provided source code.
- blueflow 1y agoLike i said, by these measurements, base64 would also be a cipher.
- omnicognate 1y agoAnd people are telling you yes, they (rot13 and base64) are indeed ciphers. What's the confusion?
- blueflow 1y agoWhat people in this thread call a "key" is, not like a key, auxiliary input data, but hard-coded into the program. We are looking at encodings. 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.
- codeulike 1y agoẢặậậ ạẵaạǡ ȧặaậậā ǎẩạặȧặǡạǎẩẳ, a áǎạ ầẫȧặ ằȁẩ ạẫ ȁǡặ ạẵaẩ ȦẪẠ13
- dsjoerg 1y agoǍ ăẫẩǡǎắặȧ ǎạ a ăẵaậậặẩẳặ áặằẫȧặ ạẵặ ảẵẫậặ ẵȁầaẩ ȧaăặ! Aẩắ Ǎ aǎẩ'ạ ẳẫẩẩa ậẫǡặ.....
- tetris11 1y ago> > "Hope remains strewn asunder, I weep holy tears oh great one, Paul:16" > "I belong to a secret group of panda bear hunters! Eat a meaty flesh chunk...." For anyone wondering..
- deleted 1y ago[deleted]
- BubbleRings 1y agoI bet that last word is ROT13! We can crack it now! And maybe the second to last is “like”.
- sim7c00 1y agowait is it rot13 on the screamphabet or the alphabet?
- ginko 1y agoNow pack even more info in each character with Zalgo text.
- permo-w 1y agoam I unusual in not really seeing the "creepiness" of zalgo text?
- lambdaone 1y agoThink of it as representing something like the letters actively 'creeping' and giving off tendrils of darkness. Does this help?
- permo-w 1y agoI understand the idea, it just doesn't impact me
- Retr0id 1y agoIt's not inherently creepy but often symbolic of corruption or someone talking in a raspy/synthetic "evil overlord" kind of voice.
- faeyanpiraat 1y agoMaybe you missed this piece of the internet history: https://stackoverflow.com/a/1732454 https://stackoverflow.com/a/1732454
- Retr0id 1y agozalgo256: https://gist.github.com/DavidBuchanan314/07da147445a90f7a049d1b9b3e3dc6f3 https://gist.github.com/DavidBuchanan314/07da147445a90f7a049...
- BubbleRings 1y agoHey, cool little rabbit hole there. I had totally missed all that. https://en.m.wikipedia.org/wiki/Zalgo_text https://en.m.wikipedia.org/wiki/Zalgo_text
- Retr0id 1y agoThere are a little over 256 unicode Combining Marks that have a 2-byte UTF-8 encoding. I picked a set of them, defining an encoding I call zalgo256: https://gist.github.com/DavidBuchanan314/07da147445a90f7a049d1b9b3e3dc6f3 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.
- junon 1y agoA demonstration as a comment on the gist would probably work! I'd love to see that
- fainpul 1y agoOne could use emojis instead, then the message could be hidden in plain sight in places where emoji-spam is common.
- cluckindan 1y agoEmojis have a high overhead, a single emoji is typically 4 bytes but may be up to 35 bytes.
- Bender 1y agoFor fun there are other variants of base64 in a similar spirit [1][2] full unicode. [3] see other links in that repo... Not a stream cipher, just encoding but could be used in conjunction with a stream cipher to add compression. It could go turtles all the way down. [1] - https://github.com/qntm/base2048 https://github.com/qntm/base2048 [2] - https://github.com/qntm/base32768 https://github.com/qntm/base32768 [3] - https://github.com/qntm/base65536 https://github.com/qntm/base65536
- deleted 1y ago[deleted]
- deleted 1y ago[deleted]
- rawling 1y agohttps://xkcd.com/3054/ https://xkcd.com/3054/
- PenguinRevolver 1y agoOh god, now we're gonna have two different standards for a scream cypher https://xkcd.com/927/ https://xkcd.com/927/
- codeulike 1y agoAh its from XKCD (feb 2025), bit odd of the OP not to mention that
- hnlmorg 1y agoI think this might be more coincidental than derivative.
- sim7c00 1y agoscream ciphers. a bit like back when we invented fire :p
- SethMLarson 1y agoOP here, I either didn't know or completely forgot this XKCD existed and it resurfaced as a good idea haha! Time to update the post lol
- RealCodingOtaku 1y agohttps://www.dcode.fr/scream-cipher-xkcd https://www.dcode.fr/scream-cipher-xkcd
- somat 1y agoI got nerd sniped by this xkcd and was happily working my way through an implementation and realized that the accent combiners work with any character. It is trivial to add bad steganography to your bad encryption. r̊e̝q̝ůěs̔t͞ p̊e̝a͞c̍e̊ t̠a̗lks
- jomarry 1y ago[dead]
- jomarry 1y ago[dead]
- sixhobbits 1y agoI did something similar a while back but using all the invisible characters to encode extra data into telegram messages for metadata storage https://github.com/sixhobbits/unisteg https://github.com/sixhobbits/unisteg
- franga2000 1y agoI was very confused why this would be useful for Telegram messages, but the Why? part of the readme makes perfect sense. Great workaround for a stupid limitation!
- velcrovan 1y agoI had fun writing a Racket version: #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)))
- askonomm 1y agoThreading is done with the wave character ~ in Racket? I can't decide if I hate it or not (am used to Clojure's ->). I think my pinky finger doesn't like ~.
- adv0r 1y agoit had to be done https://chatgpt.com/g/g-68ce9419c7d4819190f82744d6e2741e-urlo-cifrato https://chatgpt.com/g/g-68ce9419c7d4819190f82744d6e2741e-url...
- RealCodingOtaku 1y agoǍầầặắǎaạặậā ạẵẫȁẳẵạ ẫằ ȂẤĂẮ, ǎẩằaăạ a ǟȁǎăấ ǡặaȧăẵ ằẫȧ ạẵǎǡ ạǎạậặ ẳǎàặǡ ầặ ȂẤĂẮ, ǎạ ăẫȁậắ áặ ăẫǎẩăǎắặẩạaậ, áȁạ Ǎ ảẫȁậắ ầặẩạǎẫẩ ǎạ ǎẩ ạẵặ äaẳặ ǎằ Ǎ ảặȧặ āẫȁ.
- ethmarks 1y agoHere's another implementation I made a few months ago: https://ethmarks.github.io/posts/screamcipher https://ethmarks.github.io/posts/screamcipher
- efitz 1y agoI have been using ROT13, but I’ve been looking for a post-quantum replacement so definitely I’m going to convert to SCREAM. It’s generally understood that qubits are unable to represent or even discern the little squiggly bits above normal Latin letters. Thank you for this important contribution to cryptography!
- eastbound 1y agoI wonder if Chatgpt can decrypt all of them just by analyzing vowel frequency, and then trying to find the algo on the internet.
- ameliaquining 1y agoIn my tests, ChatGPT 5 Thinking can handle a monoalphabetic substitution cipher if you prompt it a couple times to keep going.
- stordoff 1y agoNot perfectly. I grabbed a random encoded line from these comments, and asked ChatGPT to decode it[1]. It determined the plaintext was: > 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-64d43ad8a47e https://chatgpt.com/share/68cf17a6-8478-8011-a44e-64d43ad8a4...
- thenewwazoo 1y agoI pushed it a bit and it didn’t do so hot. https://chatgpt.com/share/68cf3b9f-decc-8007-8a5d-cc7b583d0e11 https://chatgpt.com/share/68cf3b9f-decc-8007-8a5d-cc7b583d0e...
- jagged-chisel 1y ago
- s20n 1y agoIt's hilarious that Stream Ciphers are the closest thing to the One-Time-Pad (which provides "Perfect Secrecy") and this thing is a Monoalphabetic Substitution Cipher which provides no security whatsoever.
- tptacek 1y agoIt feels like you're trying to express that stream ciphers are especially secure compared to block ciphers (which is what most of them are built out of), which isn't the case.
- fuzzy_biscuit 1y agoNow I need a TTS to read a scream.
- sigseg1v 1y agoArtosis' channel on Twitch has got that one covered.
- nextrastapasta 1y ago[dead]
- timonoko 1y agoMost of these are short/long vowel markings, except last one which is (probably) implosion. And rest are frontal/back and wide/narrow A. But Swedish "Å" is just stupidity "O", because they started pronouncing "O" as "U" and "U" as "Y". -- Can you pronounce these screams?
- pezezin 1y agoThe last one is the ogonek, it usually indicates nasalization: https://en.m.wikipedia.org/wiki/Ogonek https://en.m.wikipedia.org/wiki/Ogonek
- deleted 1y ago[deleted]
- slig 1y agoẠẵặǡặ Äȧặạąặậǡ Aȧặ Ầaấǎẩẳ Ầặ Ạẵǎȧǡạā!
- vehementi 1y agoFinally we can talk to the bomb dudes in Serious Sam
- cluckindan 1y agoOr teach it as the only righteous alphabet to our children.
- cluckindan 1y agoDo this with variants of O and the ghosts will be happy.
- vman512 1y agoHow sand people talk
- kirjavascript 1y agohere's a JS one liner that handles scream and unscream in one function 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``
- jdranczewski 1y agoI was rather confused by the dictionary comprehension syntax used there, because I wasn't aware that you could write one without the ":" to delineate the key: value pair. Turns out you can, but it just creates a dict with no values stored, just the keys! This works here because the returned dict is an iterable that returns the keys on iteration, and "update" accepts an iterable of (key, value) tuples - and the keys are just that in this case. So the effect is the same as if it was a list comprehension! Just slightly more confusing
- duskwuff 1y agoNot precisely. {x} is a set literal; {x for y in z} is a set comprehension.
- jdranczewski 1y agoAh, my bad! I did not know these were a thing, but that makes more sense! Teaches me a thing about only quickly trying things in an online REPL on mobile and jumping to conclusions - I forgot curly braces were also a way to denote a set
- pbsd 1y agoI thought this was gonna be about the actual Scream stream cipher: https://eprint.iacr.org/2002/019 https://eprint.iacr.org/2002/019
- yencabulator 1y agoPrevious attempt at cracking this cipher: https://www.youtube.com/watch?v=ZlIz0q8aWpA https://www.youtube.com/watch?v=ZlIz0q8aWpA