data encoding and signing