This one was even worse. Not because of the typo but because of the absurd statement:
"this stub is here to stay"
"can't user(sic) blowfish or mcrypt, so..."
1 ]=> (md5-sum->hexadecimal (md5-string "fakenews"))
;Value 14: "3aefb76f8d53d8d1f7b160df9d2ac56d"
Unfortunately, I don't do drugs. I can't use that as an excuse, what happened then?
On the other hand, a lot of functions are undocumented in MIT Scheme, and you have to read the source code if you want to use them. And there isn't exactly a huge community of users outside of the academic world. I wouldn't know where to ask for help. Anyway, the cryptography does seem usable. I could try to implement tripcodes for fun.
1 ]=> (mcrypt-algorithm-names)
;Unassigned variable: mcrypt-algorithm-names-vector
;To continue, call RESTART with an option number:
; (RESTART 3) => Specify a value to use instead of mcrypt-algorithm-names-vector.
; (RESTART 2) => Set mcrypt-algorithm-names-vector to a given value.
; (RESTART 1) => Return to read-eval-print level 1.
2 error> (restart 1)
;Abort!
1 ]=> (mcrypt-available?)
;Loading "/usr/local/lib/mit-scheme-x86-64/lib/prmcrypt.so"... done
;Value: #t
Whatever, let's go on.
1 ]=> (mcrypt-algorithm-names)
;Value 15: ("tripledes" "rc2" "enigma" "blowfish" "xtea" "serpent" "rijndael-256" "des" "blowfish-compat" "wake" "saferplus" "rijndael-192" "loki97" "cast-256" "arcfour" "twofish" "rijndael-128" "gost" "cast-128")
1 ]=> (mcrypt-mode-names)
;Value 16: ("stream" "ofb" "nofb" "ncfb" "ecb" "ctr" "cfb" "cbc")
So far, so good. In src/runtime/crypto.scm
there's a function mcrypt-encrypt
with the following signature:
(define (mcrypt-encrypt context input input-start input-end output output-start encrypt?) "...")
A context can be defined like that: (define c (mcrypt-open-module "des" "ecb"))
, encrypt?
is a boolean, #t
for encryption, #f
for decryption.
... and I'm stuck.