2016-03-23 18 views
2

誰でも下記を参考にしてください。キーでConvertFrom-SecureStringを使用しているときに例外が発生しました

キーを使用して文字列を暗号化しようとしています。暗号化された値を生成している間、以下のエラーを受け取りますどこで問題なく他のサーバーで同じことができるのか。

Powershellのバージョンと比較して、両方のサーバーに同じバージョンがあります。何かヒント?

$Key = (1..16) 
$SecureString = ConvertTo-SecureString -String "mypw" -AsPlainText -Force 
ConvertFrom-SecureString -SecureString $SecureString -Key $Key 

例外の下には受信:

ConvertFrom-SecureString : Exception has been thrown by the target of an invocation. 
At line:1 char:1 
+ ConvertFrom-SecureString -SecureString $SecureString -Key $Key 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:) [ConvertFrom-SecureString], TargetInvocationException 
    + FullyQualifiedErrorId : System.Reflection.TargetInvocationException,Microsoft.PowerShell.Commands.ConvertFromSec 
    ureStringCommand 

$エラー[0] .Exception | Format-List * -force

Message  : Exception has been thrown by the target of an invocation. 
Data   : {} 
InnerException : System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS 
       validated cryptographic algorithms. 
        at System.Security.Cryptography.RijndaelManaged..ctor() 
TargetSite  : System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean) 
StackTrace  : at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, 
       Boolean constructor) 
        at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, 
       Object[] parameters, CultureInfo culture) 
        at System.Security.Cryptography.CryptoConfig.CreateFromName(String name, Object[] args) 
        at System.Security.Cryptography.SymmetricAlgorithm.Create(String algName) 
        at Microsoft.PowerShell.SecureStringHelper.Encrypt(SecureString input, Byte[] key, Byte[] iv) 
        at Microsoft.PowerShell.Commands.ConvertFromSecureStringCommand.ProcessRecord() 
        at System.Management.Automation.CommandProcessor.ProcessRecord() 
HelpLink  : 
Source   : mscorlib 
HResult  : -2146232828 

答えて

0

は、暗号化アルゴリズムをFIPSここでの問題です。

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa.に移動し、お使いのコンピュータのサブキーFipsAlgorithmPolicyのために1から0にサブキーFipsAlgorithmPolicyまたは変更DWORDを削除して再起動し

ここa link

です
関連する問題