A block cipher, an algorithm for symmetric-key encryption, takes two parameters—a plaintext and a key—and runs them through the algorithm to generate a ciphertext. The idea is to generate a seemingly random ciphertext so that the plaintext input cannot be deduced from the ciphertext (much like hashing):
const ciphertext = encrypt(plaintext, key);
However, unlike hashing, block ciphers are reversible; given the ciphertext and the key, the plaintext can be regenerated:
const plaintext = decrypt(ciphertext, key);
Using a block cipher on our digest instead of applying a pepper means that if our application server (and thus the pepper) was compromised, we can run a simple function on our database that decrypts the ciphertext back to the digest and re-encrypt it using a new key.