... in the same sense that ROT13 or base64 would be a cipher.
Rot 13 is a cipher. It's a substitution cipher, and more specifically a shift cypher or Caesar cipher. It's not a secure cipher but it is one. Base64 is an encoding. It's an algorithm, no attempt at secrecy, thus not a cipher.
Scream cipher
71–80 of 112 posts
Re: Scream cipher
#72Re: Scream cipher
#73I 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!
I’m currently building an implementation with fractional rotation. Of course I will post a Show HN when it’s ready.
Re: Scream cipher
#74 CIPHER, UNCIPHER = str.maketrans(CIPHER), str.maketrans(UNCIPHER)
print(s := 'STREAM CIPHER'.translate(CIPHER))
print(s.translate(UNCIPHER))Re: Scream cipher
#75I 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
#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 (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)))Re: Scream cipher
#76Re: Scream cipher
#77I 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!
The important part about applying ROT13 is the number of iterative applications. The security of even-numbered applications is undeniable. Odd-numbered is even better than that. I’m currently building an implementation with fractional rotation. Of course I will post a Show HN when it’s ready.
Re: Scream cipher
#78I 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!
The important part about applying ROT13 is the number of iterative applications. The security of even-numbered applications is undeniable. Odd-numbered is even better than that. I’m currently building an implementation with fractional rotation. Of course I will post a Show HN when it’s ready.
Re: Scream cipher
#79Finally we can talk to the bomb dudes in Serious Sam