3 ms·
I don't have a handy place to stash 5MB of data publicly, but you can run the following in SBCL (or the equivalent in whatever language you prefer): (in-pa
by zeveb 10y ago
I don't have a handy place to stash 5MB of data publicly, but you can run the following in SBCL (or the equivalent in whatever language you prefer):
(in-package :cl-user)
(use-package :ironclad)
(let ((data (make-array (* 5 1024 1024)
:element-type '(unsigned-byte 8)
:initial-element (char-code #\X))))
(encrypt-in-place
(make-cipher
:aes
:key (sb-ext:string-to-octets "YELLOW SUBMARINE")
:mode :ctr
:initialization-vector (make-array 16 :element-type '(unsigned-byte 8)))
data)
(with-open-file (tmp "/tmp/data" :direction :output
:element-type '(unsigned-byte 8))
(write-sequence data tmp)))
That's a file of 5,242,880 'X' characters, encrypted with the key 'YELLOW SUBMARINE' and an all-zero initialization vector. You will not be able to compress it.