trying to fix RarRijndael

This commit is contained in:
Adam Hathcock
2016-01-01 11:47:38 +00:00
parent 5647a424e7
commit fd2beeab48
2 changed files with 6 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -29,12 +29,13 @@ namespace SharpCompress.Common.Rar
aesInitializationVector = new byte[CRYPTO_BLOCK_SIZE];
int rawLength = 2 * password.Length;
byte[] rawPassword = new byte[rawLength + 8];
byte[] passwordBytes = Encoding.Unicode.GetBytes(password);
for (int i = 0; i<rawLength; i++)
byte[] passwordBytes = Encoding.UTF8.GetBytes(password);
for (int i = 0; i < password.Length; i++)
{
rawPassword[i] = passwordBytes[i];
rawPassword[i * 2] = passwordBytes[i];
rawPassword[i * 2 + 1] = 0;
}
for (int i = 0; i<salt.Length; i++)
for (int i = 0; i < salt.Length; i++)
{
rawPassword[i + rawLength] = salt[i];
}

Binary file not shown.