# Class: SymEncryptedIntegrityProtectedDataPacket

## SymEncryptedIntegrityProtectedDataPacket()

Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18)

RFC4880 5.13: The Symmetrically Encrypted Integrity Protected Data packet is a variant of the Symmetrically Encrypted Data packet. It is a new feature created for OpenPGP that addresses the problem of detecting a modification to encrypted data. It is used in combination with a Modification Detection Code packet.

## Constructor

#### new SymEncryptedIntegrityProtectedDataPacket()

Source:
  - packet/sym_encrypted_integrity_protected_data.js, line 56

### Methods

#### (async) decrypt(sessionKeyAlgorithm, key, configopt) → {Promise.<Boolean>}

Decrypts the encrypted data contained in the packet.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`sessionKeyAlgorithm` | enums.symmetric |  | The selected symmetric encryption algorithm to be used
`key` | Uint8Array |  | The key of cipher blocksize length to be used
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/sym_encrypted_integrity_protected_data.js, line 115

##### Throws:

on decryption failure

Type
  Error

##### Returns:

Type
  Promise.<Boolean>

#### (async) encrypt(sessionKeyAlgorithm, key, configopt) → {Promise.<Boolean>}

Encrypt the payload in the packet.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`sessionKeyAlgorithm` | enums.symmetric |  | The symmetric encryption algorithm to use
`key` | Uint8Array |  | The key of cipher blocksize length to be used
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/sym_encrypted_integrity_protected_data.js, line 90

##### Throws:

on encryption failure

Type
  Error

##### Returns:

Type
  Promise.<Boolean>