Skip to content

Instantly share code, notes, and snippets.

class StreamCrypto
def self.aes_ctr_encrypt(clear_text,nonce,key)
counter=nonce.unpack('q')[0]
keystream = ""
cipher = OpenSSL::Cipher.new 'aes128'
cipher.padding=0
cipher.encrypt
cipher.key=key
(Float(clear_text.length)/key.length).ceil().times do
stream_nonce="\0"*8+[counter].pack('q')
! Flexoki color scheme for the X Window System
!
! https://stephango.com/flexoki
! Dark Tones
#define yellow #AD8301
#define orange #BC5215
#define red #AF3029
#define magenta #A02F6F
#define violet #5E409D