Fix isValidEncryptionKeyPacket function: access key flags by index