base crypto framework