mirror of
https://github.com/jakcron/nstool
synced 2024-11-23 05:59:29 +00:00
159 lines
19 KiB
C++
159 lines
19 KiB
C++
#pragma once
|
|
|
|
|
|
// AES
|
|
namespace crypto
|
|
{
|
|
|
|
/*
|
|
Keys mentioned in Content Archive Authoring library
|
|
private RsaKey m_NcaHeader1SignKey;
|
|
private RsaKey m_AcidSignKey;
|
|
private RsaKey m_NrrCertificateSignKey;
|
|
private AesKey m_ProdKeyAreaEncryptionKey;
|
|
private AesKey m_ProdNcaHeaderEncryptionKek;
|
|
private RsaKey m_ProdXciHeaderSignKey;
|
|
private AesKey m_ProdXciInitialDataEncryptionKey;
|
|
private AesKey m_ProdTitleKeyGenarateKey;
|
|
private AesKey m_ProdETicketCommonKey;
|
|
private RsaKey m_ProdETicketSignKey;
|
|
*/
|
|
namespace aes
|
|
{
|
|
|
|
/*
|
|
public static AesKey GetNcaExternalContentKey(IHashCalculator hashCalculator, ulong titleId)
|
|
{
|
|
Trace.Assert(hashCalculator != null, "IHashCalculator is null.");
|
|
byte[] array = BitConverter.GetBytes(titleId).Reverse<byte>().ToArray<byte>();
|
|
byte[] numArray = new byte[hashCalculator.HashSize];
|
|
hashCalculator.CalculateHash(array, 0, (int)array.Length, numArray, 0);
|
|
return new AesKey(((IEnumerable<byte>)numArray).Where<byte>((byte name, int index) => index < 16).ToArray<byte>());
|
|
}
|
|
*/
|
|
namespace nx
|
|
{
|
|
enum Aes128KeyId
|
|
{
|
|
NcaContentKey,
|
|
NcaHeader,
|
|
XciInitialData,
|
|
XciHeader,
|
|
ETicketCommonKey
|
|
};
|
|
|
|
enum HmacSha256KeyId
|
|
{
|
|
TitleKeyGenarateKey
|
|
};
|
|
|
|
namespace dev
|
|
{
|
|
// aes128-xts keys (seem to use 512 block sizes, aka 0x200 blocks)
|
|
byte_t nca_body_key[2][16] =
|
|
{
|
|
{ 0xE5, 0x64, 0xDB, 0xFE, 0x52, 0x93, 0x3A, 0x65, 0x3C, 0x8B, 0x5E, 0xF8, 0x2C, 0x9D, 0xF4, 0xB5 },
|
|
{ 0x60, 0x7B, 0x77, 0x3E, 0x31, 0xE9, 0x6A, 0x8F, 0x8E, 0x44, 0x5C, 0x98, 0x71, 0xC0, 0x57, 0xDB },
|
|
};
|
|
|
|
byte_t nca_header_key[2][16] =
|
|
{
|
|
{ 0xCB, 0x9A, 0x93, 0x9F, 0x82, 0x72, 0x54, 0x4A, 0x74, 0x5D, 0x28, 0x46, 0x9D, 0xCC, 0x38, 0x12 },
|
|
{ 0x06, 0x31, 0x27, 0x06, 0xAE, 0x62, 0x56, 0x8C, 0x5B, 0x7E, 0xE6, 0x9F, 0x7E, 0x01, 0x02, 0x24 },
|
|
};
|
|
|
|
// aeskey, related to m_KeyAreaEncryptionKeyList (first in list?)
|
|
byte_t key_area_encryption_key_0[0x10] = { 0x3A, 0x7C, 0x3E, 0x38, 0x4A, 0x8F, 0x22, 0xFF, 0x4B, 0x21, 0x57, 0x19, 0xB7, 0x81, 0xAD, 0x0C };
|
|
|
|
byte_t titlekey_generate_key[0x20] = { 39, 111, 56, 188, 68, 106, 241, 86, 31, 44, 90, 111, 116, 32, 93, 197, 25, 181, 59, 188, 178, 159, 211, 175, 212, 178, 162, 4, 28, 152, 117, 126 };
|
|
|
|
// aes128-cbc keys
|
|
byte_t xci_header_key[16] = { 0x01, 0xC5, 0x8F, 0xE7, 0x00, 0x2D, 0x13, 0x5A, 0xB2, 0x9A, 0x3F, 0x69, 0x33, 0x95, 0x74, 0xB1 };
|
|
byte_t eticket_common_key[16] = { 0x55, 0xA3, 0xF8, 0x72, 0xBD, 0xC8, 0x0C, 0x55, 0x5A, 0x65, 0x43, 0x81, 0x13, 0x9E, 0x15, 0x3B }; // lol this 3ds dev common key
|
|
|
|
byte_t wii_sd_key[16] = { 0xAB, 0x01, 0xB9, 0xD8, 0xE1, 0x62, 0x2B, 0x08, 0xAF, 0xBA, 0xD8, 0x4D, 0xBF, 0xC2, 0xA5, 0x5D };
|
|
}
|
|
|
|
namespace prod
|
|
{
|
|
byte_t master_key[0x20][16] =
|
|
{
|
|
{ 0xC2, 0xCA, 0xAF, 0xF0, 0x89, 0xB9, 0xAE, 0xD5, 0x56, 0x94, 0x87, 0x60, 0x55, 0x27, 0x1C, 0x7D },
|
|
{ 0x54, 0xE1, 0xB8, 0xE9, 0x99, 0xC2, 0xFD, 0x16, 0xCD, 0x07, 0xB6, 0x61, 0x09, 0xAC, 0xAA, 0xA6 },
|
|
{ 0x4F, 0x6B, 0x10, 0xD3, 0x30, 0x72, 0xAF, 0x2F, 0x25, 0x05, 0x62, 0xBF, 0xF0, 0x6B, 0x6D, 0xA3 },
|
|
};
|
|
|
|
byte_t nca_header_key[2][16] =
|
|
{
|
|
{ 0xAE, 0xAA, 0xB1, 0xCA, 0x08, 0xAD, 0xF9, 0xBE, 0xF1, 0x29, 0x91, 0xF3, 0x69, 0xE3, 0xC5, 0x67 },
|
|
{ 0xD6, 0x88, 0x1E, 0x4E, 0x4A, 0x6A, 0x47, 0xA5, 0x1F, 0x6E, 0x48, 0x77, 0x06, 0x2D, 0x54, 0x2D }
|
|
};
|
|
|
|
byte_t xci_header_key[16] = { 0x01, 0xC5, 0x8F, 0xE7, 0x00, 0x2D, 0x13, 0x5A, 0xB2, 0x9A, 0x3F, 0x69, 0x33, 0x95, 0x74, 0xB1 };
|
|
/*
|
|
// encrypted with ProdNcaHeaderEncryptionKek
|
|
byte_t nca_enc_header_key[2][16] =
|
|
{
|
|
{ 0x5A, 0x3E, 0xD8, 0x4F, 0xDE, 0xC0, 0xD8, 0x26, 0x31, 0xF7, 0xE2, 0x5D, 0x19, 0x7B, 0xF5, 0xD0 },
|
|
{ 0x1C, 0x9B, 0x7B, 0xFA, 0xF6, 0x28, 0x18, 0x3D, 0x71, 0xF6, 0x4D, 0x73, 0xF1, 0x50, 0xB9, 0xD2 }
|
|
};
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
// RSA
|
|
namespace rsa
|
|
{
|
|
namespace nx
|
|
{
|
|
enum Rsa2048PssKeyId // sign/validate
|
|
{
|
|
NcaHeader1, // also reference as "sign key data"
|
|
Acid,
|
|
NrrCertificate
|
|
};
|
|
|
|
enum Rsa2048Pkcs1KeyId // sign/validate
|
|
{
|
|
XciHeader,
|
|
ETicket // XS00000020 or XS00000021 ident
|
|
};
|
|
|
|
enum RsaOaepKeyId // encrypt/decrypt
|
|
{
|
|
XciKeyArea
|
|
};
|
|
|
|
/*
|
|
in regards to etickets
|
|
%llx....string too long.invalid string position.CT..TW..NG..VP..PC..%08X....Contents of ticket at 0x%0*lx:.. Ticket ID = 0x%I64x... Version = %hd... Rights ID..... %02hhx..... Device ID = 0x%I64x... Issuer = %s.... SigType = 0x%0x..... AccountId = 0x%x.. LicenseType = %hhd.... CommonKeyId = %hhd.... PropertyMask = 0x%hx.. Title Key (encrypted and may be personalized):. .... sectTotalSize %d.. sectHdrOffset %d.. nSectHdrs %hd..... nSectHdrEntrySize %hd.....V1 Section Header %d:... sectOffset %d..... nRecords %d... recordSize %d..... sectionSize %d....PERMANENT...SUBSCRIPTION....CONTENT.CONTENT CONSUMPTION.ACCESS TITLE....Unknown.LIMITED RESOURCE.... sectionType %s.... V1 Section Records:... refId ..%02hhx .. refIdAttr %x... limit %x.... offset %x... accessMask:..... .... index %hx... code %hx.... accessTitleId %I64x..... accessTitleMask %I64x... Unknown Record Type %hx............
|
|
*/
|
|
|
|
// unknown key "EncryptionKeyData"
|
|
byte_t unk_rsa_key_mod[0x100] = { 0x85, 0xF8, 0x8C, 0x41, 0x8A, 0x2D, 0x96, 0xB3, 0xF3, 0x92, 0xD0, 0x6C, 0x9D, 0x90, 0x96, 0x7F, 0x1A, 0x78, 0xD8, 0x17, 0x7A, 0xB8, 0xEC, 0x0E, 0x6E, 0x10, 0x55, 0xC8, 0xCA, 0x7F, 0x18, 0xC7, 0x18, 0x94, 0x75, 0x0D, 0xBA, 0x19, 0x44, 0xDE, 0xFA, 0x93, 0xC8, 0xCB, 0x5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xC0, 0x99, 0x83, 0x61, 0xAD, 0xB8, 0x3E, 0x27, 0x3F, 0x0E, 0xB8, 0x9E, 0x9B, 0x11, 0x78, 0xF1, 0x06, 0x30, 0x5B, 0xCA, 0xF4, 0xEB, 0x72, 0x20, 0xD3, 0x15, 0x15, 0xC0, 0xC7, 0x1A, 0x08, 0xAE, 0x6E, 0xB2, 0x02, 0x43, 0xE9 };
|
|
|
|
// rsa2048-oaep-sha256 key
|
|
byte_t xci_keyarea_labledigest[0x20] = { 0xB1, 0x7B, 0x5F, 0x65, 0x0E, 0x75, 0x90, 0xED, 0xFE, 0x3A, 0xF0, 0x75, 0x0B, 0x92, 0x05, 0xB3, 0x0E, 0x7D, 0x49, 0x89, 0x24, 0xD8, 0xE3, 0x85, 0xCB, 0x40, 0xE0, 0xE7, 0xF8, 0xDE, 0xF0, 0x77 };
|
|
byte_t xci_keyarea_mod[0x100] = { 0xA6, 0x1A, 0x3F, 0x5E, 0x16, 0x94, 0x4D, 0x5F, 0x88, 0x07, 0x45, 0x92, 0x42, 0x02, 0x5C, 0xF8, 0xF8, 0x01, 0xA6, 0x8F, 0xF0, 0x77, 0x76, 0x06, 0x06, 0x4B, 0x67, 0x02, 0x35, 0x2F, 0xC2, 0xF6, 0xCD, 0x74, 0xBC, 0x57, 0x36, 0xA0, 0x61, 0x1D, 0xD6, 0x66, 0x35, 0x79, 0x6E, 0xB7, 0xFF, 0xC1, 0x05, 0xC6, 0x59, 0xD9, 0x1E, 0xC9, 0xC3, 0x1F, 0x5B, 0x17, 0xA9, 0x24, 0x46, 0xB3, 0xAB, 0x1D, 0x7B, 0x79, 0xA8, 0xF2, 0x80, 0xC8, 0x6F, 0xA7, 0x9B, 0x2D, 0xE8, 0xBF, 0x91, 0xD7, 0xD4, 0xA2, 0x07, 0x53, 0x98, 0x82, 0x7D, 0x91, 0x8A, 0x68, 0x79, 0x9B, 0xB6, 0x8F, 0xA7, 0x05, 0x7B, 0x2B, 0x6C, 0x09, 0x2A, 0x58,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