useful code snippets for usual crypto