Mohamed Aziz Knani :)

This is my personal blog, my interests include information security, software development and surf fishing. 

aziz

Cryptopals - set3

Challenge 17 attacking CBC with a padding attack was really interesting, here is my solution from set2 import aes_cbc_decrypt, aes_cbc_encrypt, paddpkcs7, validatepkcs7, split_blocksfrom Crypto import Randomfrom Crypto.Util.strxor import strxordef get_block(text, block, blocksize): return split_blocks(text, blocksize)[block]def produce_ciphertext(plaintext, key): blocksize = len(key) iv = Random.new().read(blocksize) return…

Continue reading...
aziz

Programming rants

I work in cyber security. I do some programming but I'm not a professional programmer. I took some software design classes in university. Hated them. I love programming just not how enterprise programs are designed: Backend web developers write wrappers around databases.Frontend web developers…

Continue reading...
aziz

Stream audio with pulseaudio

I use spotify now So I have my music collection in my laptop hard drive, I wanna be able to play and control music everywhere. For changing the current track, I use Emacs with emms and mpv, I don't have the need to use…

Continue reading...
aziz

Counsel fix org-mode tags in Emacs

Hello, another Emacs post, been using this code for probably a year so I'm sharing it. (defun org-capture-fill-template (&optional template initial annotation) "Fill a template and return the filled template as a string.The template may still contain \"%?\" for cursor positioning." (let* ((template (or…

Continue reading...
aziz

How I print books

I tend to print books or zines on paper rather than read it from the screen (I help killing one small tree every week), I have some tools to do make this easier. This is a shell script to split a pdf into chapters…

Continue reading...