PRODUCTS
Overview
Sensitive Information
1 min
there are many sensitive information in overview docid\ xkr8lrggfj7yfng1vaydd , for example, the enquirycpf present in each reports, and the cpfnumber in the v1 docid\ itiltmkqbdf 9oag6bicd report due to the presence of scenarios where partners require backtracking, we have encoded this using the aes symmetric encryption algorithm and the encrypted key should be the secretkey in the api only docid\ th0zsmtagx57xfhbbg8vw used by you go on boarding, you can contact klavi business personnel( crie\@klavi ai mailto\ crie\@klavi ai ) to create it before you use secretkey , you must replace all to blank , for example key = strings replaceall(secretkey, " ", "") if your secretkey is d41faae9 fccb 46df 8fbe 025b3fe722b9 , then the key is d41faae9fccb46df8fbe025b3fe722b9 you can refer to the example code below to decode it package main import ( 	"crypto/aes" 	"crypto/cipher" 	"crypto/rand" 	"encoding/base64" 	"fmt" 	"io" ) func encrypt(key \[]byte, text string) (string, error) { 	plaintext = \[]byte(text) 	block, err = aes newcipher(key) 	if err != nil { 	 return "", err 	} 	ciphertext = make(\[]byte, aes blocksize+len(plaintext)) 	iv = ciphertext\[ aes blocksize] 	if , err = io readfull(rand reader, iv); err != nil { 	 return "", err 	} 	stream = cipher newcfbencrypter(block, iv) 	stream xorkeystream(ciphertext\[aes blocksize ], plaintext) 	return base64 urlencoding encodetostring(ciphertext), nil } func decrypt(key \[]byte, text string) (string, error) { 	ciphertext, err = base64 urlencoding decodestring(text) 	if err != nil { 	 return "", err 	} 	block, err = aes newcipher(key) 	if err != nil { 	 return "", err 	} 	if len(ciphertext) < aes blocksize { 	 return "", fmt errorf("ciphertext too short") 	} 	iv = ciphertext\[ aes blocksize] 	ciphertext = ciphertext\[aes blocksize ] 	stream = cipher newcfbdecrypter(block, iv) 	stream xorkeystream(ciphertext, ciphertext) 	return string(ciphertext), nil } func main() { 	secretkey = \[]byte("d41faae9 fccb 46df 8fbe 025b3fe722b9") 	text = \[]byte("hello, world!") key = strings replaceall(secretkey, " ", "") //key's value will be "d41faae9fccb46df8fbe025b3fe722b9" 	encryptedtext, err = encrypt(key, text) 	if err != nil { 	 fmt println("error encrypting ", err) 	 return 	} 	fmt println("encrypted ", encryptedtext) 	decryptedtext, err = decrypt(key, encryptedtext) 	if err != nil { 	 fmt println("error decrypting ", err) 	 return 	} 	fmt println("decrypted ", decryptedtext) } from crypto cipher import aes from crypto util padding import pad, unpad secretkey = "d41faae9 fccb 46df 8fbe 025b3fe722b9" key = bytes fromhex(secretkey replace(" ", "")) \#key's value will be "d41faae9fccb46df8fbe025b3fe722b9" cipher = aes new(key, aes mode cbc) message = b"this is a secret message " padded message = pad(message, aes block size) ciphertext = cipher encrypt(padded message) iv = cipher iv decipher = aes new(key, aes mode cbc, iv=iv) decrypted padded message = decipher decrypt(ciphertext) decrypted message = unpad(decrypted padded message, aes block size) print(decrypted message)