Skip to content

Keyvault: encrypt and decrypt operation not symmetrical #23829

Open
@wuxu92

Description

@wuxu92

when we try encrypt/decrypt with APIs in terraform, we find that the result of decrypt operation of the encrypt result is not equal to the origin encrypted value. more discussion see hashicorp/terraform-provider-azurerm#20763

there are two different cases here:

with simple string

if pass a value like some-secret to encrypt, then call decrypt with the result, the decrypted value changed to some-secres
key-enc

with base64

when we pass a base64 encoded string with paddings(=), like c29tZS1zZWNyZXQ=, to encrypt, the result of decrypt will lost the padding characters.

key-enc-base64

To

Is this result as expected or any wrong with my usage on encrypt/decrypt APIs?

related operation definition:

"/keys/{key-name}/{key-version}/encrypt": {
"post": {
"tags": [
"Keys"
],
"operationId": "encrypt",

Metadata

Metadata

Assignees

No one assigned

    Labels

    KeyVaultService AttentionWorkflow: This issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions