packet.pvno := protocol version; /* 5 */ packet.msg-type := message type; /* KRB_AP_REP */ body.ctime := packet.ctime; body.cusec := packet.cusec; if (selecting sub-session key) then select sub-session key; body.subkey := sub-session key; endif if (using sequence numbers) then select initial sequence number; body.seq-number := initial sequence; endif encode body into OCTET STRING; select encryption type; encrypt OCTET STRING into packet.enc-part;