File decryption

This interface helps you decrypt files you have downloaded using symmetric encryption algorithms.Here is the sample code to decrypt data.

package main

import (
	"fmt"
	"errors"
	"github.com/CESSProject/cess-go-sdk/core/crypte"
)

func main(){
    cipherText:=[]byte("test user cipher text...")
    key:=[]byte("test user aes key")
    plainText,err:=crypte.AesCbcEncrypt(data,key)
    if err!=nil{
        fmt.Println("decrypt data error",err)
    }
    fmt.Println("decrypt data sucess, the plain text is :",plainText)
}

If you first perform redundant encoding and fragmentation operations on the file, and then encrypt each fragment, after you download the corresponding fragments, you need to decrypt each fragment first and then restore it to your user file.

Last updated