code: func EncryptDataV3(data, auth []byte, scryptN, scryptP int) (CryptoJSON, error) {
  
  	salt := make([]byte, 32)
  	if _, err := io.ReadFull(rand.Reader, salt); err != nil {
  		panic("reading from crypto/rand failed: " + err.Error())
  	}
  	derivedKey, err := scrypt.Key(auth, salt, scryptN, scryptR, scryptP, scryptDKLen)
  	if err != nil {
  		return CryptoJSON{}, err
  	}
  	encryptKey := derivedKey[:16]
  
  	iv := make([]byte, aes.BlockSize) // 16
  	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
  		panic("reading from crypto/rand failed: " + err.Error())
  	}
  	cipherText, err := aesCTRXOR(encryptKey, data, iv)
  	if err != nil {
  		return CryptoJSON{}, err
  	}
  	mac := crypto.Keccak256(derivedKey[16:32], cipherText)
  
  	scryptParamsJSON := make(map[string]interface{}, 5)
  	scryptParamsJSON["n"] = scryptN
  	scryptParamsJSON["r"] = scryptR
  	scryptParamsJSON["p"] = scryptP
  	scryptParamsJSON["dklen"] = scryptDKLen
  	scryptParamsJSON["salt"] = hex.EncodeToString(salt)
  	cipherParamsJSON := cipherparamsJSON{
  		IV: hex.EncodeToString(iv),
  	}
  
  	cryptoStruct := CryptoJSON{
  		Cipher:       "aes-128-ctr",
  		CipherText:   hex.EncodeToString(cipherText),
  		CipherParams: cipherParamsJSON,
  		KDF:          keyHeaderKDF,
  		KDFParams:    scryptParamsJSON,
  		MAC:          hex.EncodeToString(mac),
  	}
  	return cryptoStruct, nil
  }
docs: // Encryptdata encrypts the data given as 'data' with the password 'auth'.