epa-decrypt-region

epa-decrypt-region is an interactive autoloaded compiled Lisp function in `epa.el'.

It is bound to <menu-bar> <tools> <encryption-decryption> <decrypt-region>.

(epa-decrypt-region START END &optional MAKE-BUFFER-FUNCTION)

Decrypt the current region between START and END.

If MAKE-BUFFER-FUNCTION is non-nil, call it to prepare an output buffer.
It should return that buffer. If it copies the input, it should
delete the text now being decrypted. It should leave point at the
proper place to insert the plaintext.

Be careful about using this command in Lisp programs!
Since this function operates on regions, it does some tricks such
as coding-system detection and unibyte/multibyte conversion. If
you are sure how the data in the region should be treated, you
should consider using the string based counterpart
`epg-decrypt-string', or the file based counterpart
`epg-decrypt-file' instead.

For example:

(let ((context (epg-make-context 'OpenPGP)))
(decode-coding-string
(epg-decrypt-string context (buffer-substring start end))
'utf-8))