Skip to content

Commit 9ecc925

Browse files
author
simonmkwii
committed
Fixed stuff
1 parent 859cc24 commit 9ecc925

16 files changed

Lines changed: 849 additions & 377 deletions

NCABuilder.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
11+
Debug|x64 = Debug|x64
1112
Release|Any CPU = Release|Any CPU
13+
Release|x64 = Release|x64
1214
EndGlobalSection
1315
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1416
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1517
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Debug|x64.ActiveCfg = Debug|x64
19+
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Debug|x64.Build.0 = Debug|x64
1620
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Release|Any CPU.ActiveCfg = Release|Any CPU
1721
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Release|x64.ActiveCfg = Release|x64
23+
{56B6D80D-05D1-4A7D-9BBB-16EF69894837}.Release|x64.Build.0 = Release|x64
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

NCABuilder/App.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<configuration>
3+
<configSections>
4+
</configSections>
35
<startup>
46
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
57
</startup>

NCABuilder/CryptoInitialisers.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ public static byte[] GenerateRandomKey(int Length)
1313
RNG.GetBytes(RandomKey);
1414
return RandomKey;
1515
}
16+
1617
public static byte[] GenSHA256Hash(byte[] Data)
1718
{
1819
var SHA = SHA256.Create();
1920
return SHA.ComputeHash(Data);
2021
}
22+
2123
// Thanks, Falo!
2224
public static byte[] AES_XTS(byte[] Key1, byte[] Key2, int SectorSize, byte[] Data, ulong Sector)
2325
{
@@ -36,6 +38,7 @@ public static byte[] AES_XTS(byte[] Key1, byte[] Key2, int SectorSize, byte[] Da
3638
}
3739
return MemStrm.ToArray();
3840
}
41+
3942
public static byte[] AES_EBC(byte[] Key, byte[] Data)
4043
{
4144
var AES = new RijndaelManaged
@@ -47,6 +50,7 @@ public static byte[] AES_EBC(byte[] Key, byte[] Data)
4750
AES.CreateEncryptor().TransformBlock(Data, 0, 0x40, TransformedData, 0);
4851
return TransformedData;
4952
}
53+
5054
public static byte[] AES_CTR(byte[] Key, byte[] CTR, byte[] Data)
5155
{
5256
byte[] Buffer = new byte[Data.Length];
@@ -56,5 +60,13 @@ public static byte[] AES_CTR(byte[] Key, byte[] CTR, byte[] Data)
5660
Transform.TransformBlock(Data, 0, Data.Length, Buffer, 0);
5761
return Buffer;
5862
}
63+
64+
public static byte[] Encrypt_RSA_2048_OAEP_MGF1_SHA256(byte[] Input, RSAParameters Params)
65+
{
66+
var RSA = new RSACng();
67+
RSA.ImportParameters(Params);
68+
var SHA256Padding = RSAEncryptionPadding.CreateOaep(HashAlgorithmName.SHA256);
69+
return RSA.Encrypt(Input, SHA256Padding);
70+
}
5971
}
6072
}

NCABuilder/Frontend.Designer.cs

Lines changed: 63 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)