私は結局c#コマンドラインを作成しました。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
using System.IO;
using System.Security.Cryptography;
class Program
{
static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("<key> <iv> <encryptedfile> <outputdecryptedfile>");
Environment.Exit(-1);
}
//Console.ReadLine();
byte[] encryptionKey = StringToByteArray(args[0]);
byte[] encryptionIV = StringToByteArray(args[1]);
try
{
using (FileStream outputFileStream = new FileStream(args[3], FileMode.CreateNew))
{
using (FileStream inputFileStream = new FileStream(args[2], FileMode.Open))
{
using (var aes = new AesManaged { Key = encryptionKey, IV = encryptionIV, Mode = CipherMode.CBC })
using (var encryptor = aes.CreateDecryptor())
using (var cryptoStream = new CryptoStream(inputFileStream, encryptor, CryptoStreamMode.Read))
{
cryptoStream.CopyTo(outputFileStream);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
public static byte[] StringToByteArray(string hex)
{
return Enumerable.Range(0, hex.Length)
.Where(x => x % 2 == 0)
.Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
.ToArray();
}
}
}
著作権のある動画会社のメディアに所属しています。暗号化が行われたことを確認するためにテストする必要があります。これは、間違ったキーで解読しようとすると興味深い考えです。次に、別の結果が得られるかどうかを確認するために正しいキーを入力してください:) – user952342
powershellでキーを使用してファイルを解読する簡単なコマンドはありますか? – user952342
@ user952342単純なコマンドではありませんが、それは/ too/badではありません。 「powershell cryptography aes」を検索し、いくつかのサンプルを見つけることができます。このページの最後にあるMSDN - http://msdn.microsoft.com/en-us/library/system.security.cryptography.aes.aes aspx - powershellサンプルがあります - AESも使用しています。 –