Created
August 31, 2016 22:28
Star
You must be signed in to star a gist
Encrypted Store Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$RSA = New-RSAKeyPair | |
# local tests | |
$ComputerName = 'localhost' | |
$StorePath = 'C:\Temp\temp.bin' | |
Write-Host "`n[$ComputerName] AES Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -StorePath $StorePath -Key 'Password123!' | |
Read-EncryptedStore -StorePath $StorePath -Key 'Password123!' -List | |
Get-EncryptedStoreData -StorePath $StorePath | Remove-EncryptedStore | |
Start-Sleep -Seconds 1 | |
Write-Host "`n[$ComputerName] RSA Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -StorePath $StorePath -Key $RSA.Pub | |
Read-EncryptedStore -StorePath $StorePath -Key $RSA.Priv -List | |
Get-EncryptedStoreData -StorePath $StorePath | Remove-EncryptedStore | |
Start-Sleep -Seconds 1 | |
$StorePath = 'HKLM:\SOFTWARE\Microsoft\SystemCertificates\DomainCertificate' | |
Write-Host "`n[$ComputerName] AES Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -StorePath $StorePath -Key 'Password123!' | |
Read-EncryptedStore -StorePath $StorePath -Key 'Password123!' -List | |
Get-EncryptedStoreData -StorePath $StorePath | Remove-EncryptedStore | |
Start-Sleep -Seconds 1 | |
Write-Host "`n[$ComputerName] RSA Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -StorePath $StorePath -Key $RSA.Pub | |
Read-EncryptedStore -StorePath $StorePath -Key $RSA.Priv -List | |
Get-EncryptedStoreData -StorePath $StorePath | Remove-EncryptedStore | |
Start-Sleep -Seconds 1 | |
$StorePath = 'ROOT\Software:WindowsUpdate' | |
Write-Host "`n[$ComputerName] AES Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -StorePath $StorePath -Key 'Password123!' | |
Read-EncryptedStore -StorePath $StorePath -Key 'Password123!' -List | |
Get-EncryptedStoreData -StorePath $StorePath | Remove-EncryptedStore | |
Start-Sleep -Seconds 1 | |
$StorePath = 'ROOT\Software:WindowsUpdate' | |
Write-Host "`n[$ComputerName] RSA Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -StorePath $StorePath -Key $RSA.Pub | |
Read-EncryptedStore -StorePath $StorePath -Key $RSA.Priv -List | |
Get-EncryptedStoreData -StorePath $StorePath | Remove-EncryptedStore | |
Start-Sleep -Seconds 1 | |
# remote tests | |
$ComputerName = 'PRIMARY.testlab.local' | |
$Credential = Get-Credential 'TESTLAB\administrator' | |
$StorePath = 'C:\Temp\temp2.bin' | |
Write-Host "`n[$ComputerName] AES Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key 'Password123!' | |
Read-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key 'Password123!' -List | |
Get-EncryptedStoreData -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath | Remove-EncryptedStore -ComputerName $ComputerName -Credential $Credential | |
Start-Sleep -Seconds 1 | |
Write-Host "`n[$ComputerName] RSA Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key $RSA.Pub | |
Read-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key $RSA.Priv -List | |
Get-EncryptedStoreData -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath | Remove-EncryptedStore -ComputerName $ComputerName -Credential $Credential | |
Start-Sleep -Seconds 1 | |
$StorePath = 'HKLM:\SOFTWARE\Microsoft\SystemCertificates\DomainCert' | |
Write-Host "`n[$ComputerName] AES Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key 'Password123!' | |
".\u2.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key 'Password123!' | |
Read-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key 'Password123!' -List | |
Get-EncryptedStoreData -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath | Remove-EncryptedStore -ComputerName $ComputerName -Credential $Credential | |
Start-Sleep -Seconds 1 | |
Write-Host "`n[$ComputerName] RSA Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key $RSA.Pub | |
".\u2.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key $RSA.Pub | |
Read-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key $RSA.Priv -List | |
Get-EncryptedStoreData -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath | Remove-EncryptedStore -ComputerName $ComputerName -Credential $Credential | |
Start-Sleep -Seconds 1 | |
$StorePath = 'ROOT\Software:WindowsUpdate2' | |
Write-Host "`n[$ComputerName] AES Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key 'Password123!' | |
Read-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key 'Password123!' -List | |
Get-EncryptedStoreData -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath | Remove-EncryptedStore -ComputerName $ComputerName -Credential $Credential | |
Start-Sleep -Seconds 1 | |
Write-Host "`n[$ComputerName] RSA Storepath : $StorePath" | |
".\secret.txt" | Write-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key $RSA.Pub | |
Read-EncryptedStore -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath -Key $RSA.Priv -List | |
Get-EncryptedStoreData -ComputerName $ComputerName -Credential $Credential -StorePath $StorePath | Remove-EncryptedStore -ComputerName $ComputerName -Credential $Credential | |
Start-Sleep -Seconds 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment