每次使用RSA加密生成不同的IV

The generated IV is correct or not every time it will give me some random output or is their any other way to do this.

ciphertext := make([]byte, aes.BlockSize+len(plaintext))
    iv := ciphertext[:aes.BlockSize]
    iv = key[:aes.BlockSize]
    if _, err := io.ReadFull(rand.Reader, iv); err != nil {
        panic(err)
    }
    log.Println("IV Simple String:", string(iv))

Give some random result like

��=�      49k�Ɓ�ʲ��

Can't even understand this !!!

If you want to make it human readable, you've got couple options:

  • base64

    base64.StdEncoding.EncodeToString(iv)

  • Hex

    hex.EncodeToString(iv)

and so on.