---
title: Decryption of reports
slug: ki/decryption-of-reports
description: Learn how to encrypt and decrypt JSON reports for PII compliance with this insightful document. Get a step-by-step GoLang example that demonstrates the encryption process using a private key and decryption using a public key. The provided example code inc
docTags: 
createdAt: 2023-06-30T03:35:35.156Z
---

For PII (personal identity information) compliance purpose, the JSON report will be encrypted and could be decrypted through the public key previously provided.

**GoLang example:&#x20;**

```go
import (
   "fmt"

   "github.com/wenzhenxi/gorsa"
)

var PublicKey = `-----BEGIN PUBLIC KEY-----
xxxxxxx
-----END PUBLIC KEY-----`

var PrivateKey = `-----BEGIN RSA PRIVATE KEY-----
yyyyyyy
-----END RSA PRIVATE KEY-----`

func main() {
   data := "hello world"

   priEncrypt, _ := gorsa.PriKeyEncrypt(data,PrivateKey)
   pubDecrypt, _ := gorsa.PublicDecrypt(priEncrypt,PublicKey)
   
   fmt.Println(pubDecrypt)
}
```



