GitHunt
WE

webmd-health-services/Carbon.Cryptography

Cross-platform PowerShell module that makes encrypting and decrypting strings (using standard cryptographic algorithms) and managing certificates easy.

Carbon.Cryptography

Overview

The "Carbon.Cryptography" module has functions that help manage X509 certificates and working with secure strings.

It started out as part of the Carbon module. But when that module become too big and unwieldy,
its security-related functionality was moved into this module.

System Requirements

  • Windows PowerShell 5.1 and .NET 4.6.1+
  • PowerShell Core 6+

Dependencies

Carbon.Cryptography has a private, nested dependency on PureInvoke 1.0.1.

Installing

To install globally:

Install-Module -Name 'Carbon.Cryptography'
Import-Module -Name 'Carbon.Cryptography'

To install privately:

Save-Module -Name 'Carbon.Cryptography' -Path '.'
Import-Module -Name '.\Carbon.Cryptography'

Commands

  • Convert-CSecureStringToByte: converts a secure string into an array of bytes (that can be easily cleared from from
    memory, unlike strings, who hang out forever).
  • Convert-CSecureStringToString: converts secure strings to strings.
  • Get-CCertificate: reads X509 certificates from files or, on Windows, from the Windows certificate stores.
  • Install-CCertificate: Installs X509 certificates into the Windows certificate store.
  • Protect-CString: Encrypt a string using the Windows Data Protection API (DPAPI; Windows only), public/private key
    cryptography, or symmetric cryptography.
  • Uninstall-CCertificate: Removes X509 certificates from the Windows certificate store.
  • Unprotect-CFileToken: Finds and decrypts all encrypted tokens within a file which were encrypted with Protect-CString.
  • Unprotect-CString: Decrypt a string that was encrypted with Protect-CString.

Languages

PowerShell100.0%

Contributors

Apache License 2.0
Created January 28, 2021
Updated August 17, 2025
webmd-health-services/Carbon.Cryptography | GitHunt