Bugfix: Secret to hexstring conversion

Slice needs to be taken before hexlify