English 中文(简体)
gpg with powerhell - Passphrase security
原标题:gpg with powershell - passphrase security

我用gnupg来通过权力书加密和加密数据,而问题在于,我在守则中已经穿过了手法。 这当然不是最佳解决办法。 什么是提供口版的最佳和安全方式? 谢谢。

C:"Program Files"GNUGnuPGgpg2.exe --passphrase mypassphrase --batch --output C:$decrypted_file.xls --decrypt C:\_Zo$encrypted_file
最佳回答

你们 接收磁带或磁盘上的密码。

以下解决办法使用计算机作为用户<>。

The following two scripts the securot framework . NET组件。

对于服务器计算机,可以通过计算机身份保护秘密。 该法典利用的是,任何能够操作计算机密码的人都可以查阅密码。 因此,密码档案可在网络上相互连接,只能由服务器本身编码。 您可在密码文档中添加《法律公报》,供某些用户阅读。

www.un.org/spanish/ecosoc 电话:

# Mandatory Framework .NET Assembly 
Add-Type -assembly System.Security

# String to Crypt
$passwordASCII = Read-Host -Prompt "Entrer le mot de passe"

# String to INT Array
$enc = [system.text.encoding]::Unicode
$clearPWD_ByteArray = $enc.GetBytes( $passwordASCII.tochararray())

# Crypting
$secLevel = [System.Security.Cryptography.DataProtectionScope]::LocalMachine
$bakCryptedPWD_ByteArray = [System.Security.Cryptography.ProtectedData]::Protect($clearPWD_ByteArray, $null, $secLevel)

# Store in Base 64 form
$B64PWD_ByteArray = [Convert]::ToBase64String($bakCryptedPWD_ByteArray)
Set-Content -LiteralPath c:Temppass.txt -Value $B64PWD_ByteArray

<>DeCoding>:

# Mandatory Framework .NET Assembly
Add-Type -assembly System.Security

# Getting from Base 64 storage
$resCryptedPWD_ByteArray = [Convert]::FromBase64String((Get-Content -LiteralPath c:Temppass.txt))

# Decoding
$secLevel = [System.Security.Cryptography.DataProtectionScope]::LocalMachine
$clearPWD_ByteArray = [System.Security.Cryptography.ProtectedData]::Unprotect( $resCryptedPWD_ByteArray, $null, $secLevel )

# Dtring from int Array
$enc = [system.text.encoding]::Unicode
$enc.GetString($clearPWD_ByteArray)
问题回答

暂无回答




相关问题
Mutually exclusive powershell parameters

SCENARIO I m writing a cmdlet for Powershell 2.0 using Visual Studio 2008 and .NET 3.5 the cmdlet requires 3 arguments. my intended grammar of the cmdlet is something like this: cmdletname [foo|...

Run a program from PowerShell with timeout

I ll write a script that runs a program and wait for it finished. But if the program is not finished within a specified time I want that the program is killed.

How to transpose data in powershell

I have a file that looks like this: a,1 b,2 c,3 a,4 b,5 c,6 (...repeat 1,000s of lines) How can I transpose it into this? a,b,c 1,2,3 4,5,6 Thanks

Powershell v2 remoting and delegation

I have installed Powershell V2 on 2 machines and run Enable-PsRemoting on both of them. Both machines are Win 2003 R2 and are joined to the same active directory domain and I can successfully run ...

PowerShell -match operator and multiple groups

I have the following log entry that I am processing in PowerShell I m trying to extract all the activity names and durations using the -match operator but I am only getting one match group back. I m ...