General purpose crypto utilities