added crypto functions