Answers for "Hashicorp Vault create encryption key in transit from CLI"

0

Hashicorp Vault create encryption key in transit from CLI

#Encryption Key creation from CLI
vault write -f mytransit/keys/my-key
Posted by: Guest on October-12-2020
0

encrypt and decrypt in hashicorp vault

#For encrypting the data in CLI
>>vault write <Transit Engine path>/encrypt/<Created encryption key name> plaintext=$(base64 <<< "My Name is Ankit Sambhare")
#for encryting the data in Powershell
>>vault write mytransit/encrypt/my-key plaintext=$([Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes("My Name is Ankit Sambhare")))

#Use below Website to check your encryption and decryption
https://www.base64decode.org/

#for Decrypting the ciphertext from CLI
>>vault write mytransit/decrypt/my-key ciphertext=vault:v1:Y0W/bCFfDPyl3b+Pqj+GD7+BRcbSYXZpNkAjEAYayhDBRfUDX+w6mfJKps2FLZmvJkoxUreQfmatUevthFNRdAs/lWEULpKmQRgCEr/g
Key          Value
---          -----
plaintext    TQB5ACAATgBhAG0AZQAgAGkAcwAgAEEAbgBrAGkAdAAgAFMAYQBtAGIAaABhAHIAZQA=

>>base64 --decode <<< "TQB5ACAATgBhAG0AZQAgAGkAcwAgAEEAbgBrAGkAdAAgAFMAYQBtAGIAaABhAHIAZQA=
"
#For decrypting the ciphertext from Powershell 1st command is same 
>>vault write mytransit/decrypt/my-key ciphertext=vault:v1:Y0W/bCFfDPyl3b+Pqj+GD7+BRcbSYXZpNkAjEAYayhDBRfUDX+w6mfJKps2FLZmvJkoxUreQfmatUevthFNRdAs/lWEULpKmQRgCEr/g | Out-File .\output

>>[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("$(Get-Content .\output | select -Skip 2 | Foreach {($_ -split '\s+',4)[1]})"))
Posted by: Guest on October-11-2020
0

Hashicorp Vault create encryption key in transit from CLI

#Encryption Key creation from CLI
vault write -f mytransit/keys/my-key
Posted by: Guest on October-12-2020
0

encrypt and decrypt in hashicorp vault

#For encrypting the data in CLI
>>vault write <Transit Engine path>/encrypt/<Created encryption key name> plaintext=$(base64 <<< "My Name is Ankit Sambhare")
#for encryting the data in Powershell
>>vault write mytransit/encrypt/my-key plaintext=$([Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes("My Name is Ankit Sambhare")))

#Use below Website to check your encryption and decryption
https://www.base64decode.org/

#for Decrypting the ciphertext from CLI
>>vault write mytransit/decrypt/my-key ciphertext=vault:v1:Y0W/bCFfDPyl3b+Pqj+GD7+BRcbSYXZpNkAjEAYayhDBRfUDX+w6mfJKps2FLZmvJkoxUreQfmatUevthFNRdAs/lWEULpKmQRgCEr/g
Key          Value
---          -----
plaintext    TQB5ACAATgBhAG0AZQAgAGkAcwAgAEEAbgBrAGkAdAAgAFMAYQBtAGIAaABhAHIAZQA=

>>base64 --decode <<< "TQB5ACAATgBhAG0AZQAgAGkAcwAgAEEAbgBrAGkAdAAgAFMAYQBtAGIAaABhAHIAZQA=
"
#For decrypting the ciphertext from Powershell 1st command is same 
>>vault write mytransit/decrypt/my-key ciphertext=vault:v1:Y0W/bCFfDPyl3b+Pqj+GD7+BRcbSYXZpNkAjEAYayhDBRfUDX+w6mfJKps2FLZmvJkoxUreQfmatUevthFNRdAs/lWEULpKmQRgCEr/g | Out-File .\output

>>[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("$(Get-Content .\output | select -Skip 2 | Foreach {($_ -split '\s+',4)[1]})"))
Posted by: Guest on October-11-2020

Code answers related to "Hashicorp Vault create encryption key in transit from CLI"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language