code: func (p *PrivateKey) Encrypt(passphrase string) error {
  	p.Salt = make([]byte, saltLength)
  	if n, err := crypto_rand.Read(p.Salt); err != nil || n < len(p.Salt) {
  		return err
  	}
  	secretKey := p.deriveKey(passphrase)
  
  	var nonce [nonceLength]byte
  	if _, err := io.ReadFull(crypto_rand.Reader, nonce[:]); err != nil {
  		return err
  	}
  	p.Nonce = nonce
  
  	p.EncryptedData = secretbox.Seal(nil, p.privateKey[:], &nonce, &secretKey)
  	return nil
  }
docs: // Encrypt encrypts the private key material with the given passphrase