Protect-KFData

Syntax

Protect-KFData 
  -String <string> 
  [-ThrowErrors[:$true]]
Protect-KFData 
  -Bytes <bytes-as-array> 
  [-ThrowErrors[:$true]]
Protect-KFData 
  -Object <object>
  [-ThrowErrors[:$true]]

Support

>= kenaflow 2.0.19

Return

Encrypted data as Base64 encoded string.

(This string start with one of the characters "s" (for "string"), "b" (for "bytes") or "o" (for object).)

Description

This cmdlet can be used to encrypt data.

The EncryptionPassphrase from the global configuration is used for encryption.

If -Object is specified the given <object> will be serialized as PowerShell CliXML before encryption.

Parameters

-String <string>

This <string> will be encrypted.

-Bytes <bytes-as-array>

The given System.Bytes array will be encrypted.

-Object <object>

The specified object will be serialized as CliXML an then encrypted.

Examples

$encryptedData = Protect-KFData -Object @{Hello="kenaflow"}
Write-KFLogOutput (Unprotect-KFData $encryptedData)

Discussion