Improved keying material encoding