Go Back  
Reply
 
Thread Tools
Old 10-27-2012   #461
hellsing9
Hired Gun
 
hellsing9's Avatar
 
Join Date: May 2011
Posts: 6,710
Likes: 2,528
Liked 3,262 Times in 1,807 Posts
Mentioned: 971 Post(s)
Tagged: 1 Thread(s)
Originally Posted by redcfw View Post
4.30 key algo



u8 erk_hkey[] = { 0xAA, 0xF6, 0x5A, 0x91, 0xEC, 0x37, 0x2C, 0x69, 0x09, 0x69, 0x09, 0x0F, 0x59, 0xE5, 0x3C, 0x3E };
u8 iv_hkey[] = { 0x66, 0xBC, 0xB4, 0x17, 0xD1, 0x4A, 0x2B, 0x59, 0x26, 0x40, 0x80, 0x1C, 0x11, 0xB7, 0xB4, 0x9B };
u8 erk_iv[] = { 0xA5, 0x79, 0x8C, 0x25, 0x43, 0x13, 0xBC, 0x54, 0x16, 0x95, 0x1E, 0x24, 0xEA, 0xD3, 0xC9, 0x85 };
u8 iv_iv[] = { 0x2F, 0xF2, 0x36, 0x15, 0x2A, 0x47, 0x76, 0xDA, 0xD3, 0x9B, 0x50, 0x92, 0x44, 0xE8, 0xF5, 0xC2 };
u8 ch73[] = { 0x40, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //?? i dont get it yet

u8 key341s[] = { 0x54,0x6B,0x2F,0xF3,0xFE,0x21,0x6E,0xD2,0xBA,0x86,0x5C,0x79,0x36,0x81, 9,0xA1, //; erk secret NPKEY
0x5F,0x2B, 0xD,0x23,0xC2, 3,0x13,0x54,0xB1,0xF6,0xF3,0x6B, 0xF,0xDB,0x4D,0x46 ,// erk
0x9B,0x87,0x1D,0x64,0x14,0xB8,0xAA,0xCE,0x54,0x2C,0x18,0x10, 0xA,0xC2,0x18,0x93 };// iv
u8 key341[] = { 0xBB,0x4D,0xBF,0x66,0xB7,0x44,0xA3,0x39,0x34,0x17,0x2D,0x9F,0x83,0x79,0xA7,0xA5,
0xEA,0x74,0xCB,0xF,0x55,0x9B,0xB9,0x5D,0xE,0x7A,0xEC,0xE9,0x17, 2,0xB7, 6,
0xAD,0xF7,0xB2, 7,0xA1,0x5A,0xC6, 1,0x11,0xE,0x61,0xDD,0xFC,0x21,0xA,0xF6};
u8 keyd[0x30];


void key430()
{
AES_ctx ctxErk, ctxIv;
u8 ch73shErk[0x10], ch73shIv[0x10];

hmac_sha1(ch73,0xa,erk_hkey,0x10,ch73shErk,16); //16 = 128bit hash
AES_set_key(&ctxErk, ch73shErk, 128);
AES_cbc_decrypt_iv(&ctxErk, key341s, keyd, 0x20, erk_iv, 1);

hmac_sha1(ch73,0xa,iv_hkey,0x10,ch73shIv,16); //16 = 128bit hash
AES_set_key(&ctxIv, ch73shIv, 128);
AES_cbc_decrypt_iv(&ctxIv, key341s+0x20, keyd+0x20, 0x10, iv_iv, 1);
}
Source? @redcfw
hellsing9 is offline   Reply With Quote
Old 10-27-2012   #462
diesel701
Member
 
diesel701's Avatar
 
Join Date: Aug 2012
Posts: 116
Likes: 15
Liked 19 Times in 14 Posts
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
Originally Posted by redcfw View Post
4.30 key algo

u8 erk_hkey[] = { 0xAA, 0xF6, 0x5A, 0x91, 0xEC, 0x37, 0x2C, 0x69, 0x09, 0x69, 0x09, 0x0F, 0x59, 0xE5, 0x3C, 0x3E };
u8 iv_hkey[] = { 0x66, 0xBC, 0xB4, 0x17, 0xD1, 0x4A, 0x2B, 0x59, 0x26, 0x40, 0x80, 0x1C, 0x11, 0xB7, 0xB4, 0x9B };
u8 erk_iv[] = { 0xA5, 0x79, 0x8C, 0x25, 0x43, 0x13, 0xBC, 0x54, 0x16, 0x95, 0x1E, 0x24, 0xEA, 0xD3, 0xC9, 0x85 };
u8 iv_iv[] = { 0x2F, 0xF2, 0x36, 0x15, 0x2A, 0x47, 0x76, 0xDA, 0xD3, 0x9B, 0x50, 0x92, 0x44, 0xE8, 0xF5, 0xC2 };
u8 ch73[] = { 0x40, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //?? i dont get it yet

u8 key341s[] = { 0x54,0x6B,0x2F,0xF3,0xFE,0x21,0x6E,0xD2,0xBA,0x86,0x5C,0x79,0x36,0x81, 9,0xA1, //; erk secret NPKEY
0x5F,0x2B, 0xD,0x23,0xC2, 3,0x13,0x54,0xB1,0xF6,0xF3,0x6B, 0xF,0xDB,0x4D,0x46 ,// erk
0x9B,0x87,0x1D,0x64,0x14,0xB8,0xAA,0xCE,0x54,0x2C,0x18,0x10, 0xA,0xC2,0x18,0x93 };// iv
u8 key341[] = { 0xBB,0x4D,0xBF,0x66,0xB7,0x44,0xA3,0x39,0x34,0x17,0x2D,0x9F,0x83,0x79,0xA7,0xA5,
0xEA,0x74,0xCB,0xF,0x55,0x9B,0xB9,0x5D,0xE,0x7A,0xEC,0xE9,0x17, 2,0xB7, 6,
0xAD,0xF7,0xB2, 7,0xA1,0x5A,0xC6, 1,0x11,0xE,0x61,0xDD,0xFC,0x21,0xA,0xF6};
u8 keyd[0x30];


void key430()
{
AES_ctx ctxErk, ctxIv;
u8 ch73shErk[0x10], ch73shIv[0x10];

hmac_sha1(ch73,0xa,erk_hkey,0x10,ch73shErk,16); //16 = 128bit hash
AES_set_key(&ctxErk, ch73shErk, 128);
AES_cbc_decrypt_iv(&ctxErk, key341s, keyd, 0x20, erk_iv, 1);

hmac_sha1(ch73,0xa,iv_hkey,0x10,ch73shIv,16); //16 = 128bit hash
AES_set_key(&ctxIv, ch73shIv, 128);
AES_cbc_decrypt_iv(&ctxIv, key341s+0x20, keyd+0x20, 0x10, iv_iv, 1);
}
Naehrwert days ago have shared this: http://pastie.org/5089738
It's similar...
diesel701 is offline   Reply With Quote
Old 10-27-2012   #463
kongen12
Member
 
kongen12's Avatar
 
Join Date: May 2011
Posts: 64
Likes: 0
Liked 6 Times in 3 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
hwat can we use this algo key for?
kongen12 is offline   Reply With Quote
Old 10-27-2012   #464
zadow28
Member
 
Join Date: Dec 2011
Posts: 360
Likes: 235
Liked 857 Times in 185 Posts
Mentioned: 188 Post(s)
Tagged: 0 Thread(s)
I have been looking at the pastie too. and translate the pastie into an openssl command


test command
Code:
Zadow ~/ssl
$ openssl aes-128-cbc -d -in all.bin -out decall.bin -nosalt -K ( TEST ERK) -iv (TEST IV ) -p -nopad
key=8EACAB1950A79147DB391A88FCF9DE1B097C5667DBB6F6E1FEAA4980AB4E7E1B
iv =ACA5B101EC4B9497691632917E555472

Code:
Zadow
@zadow
-PC ~/ssl
$ openssl aes-128-cbc -d -in all.bin -out decall.bin -nosalt -K 8EACAB1950A79147DB391A88FCF9DE1B097C5667DBB6F6E1FEAA4980AB4E7E1B -iv ACA5B101EC4B9497691632917E555472 -p -nopad
key=8EACAB1950A79147DB391A88FCF9DE1B097C5667DBB6F6E1FEAA4980AB4E7E1B
iv =ACA5B101EC4B9497691632917E555472
you have to have an all.bin
that is the 48 hex bytes of the erk+riv (the scrampled one)

then in the command -K 8EACAB1950A79147DB391A88FCF9DE1B097C5667DBB6F6E1FEAA4980AB4E7E1B -iv ACA5B101EC4B9497691632917E555472 is where you put you test erk and iv

if it decrypts right the decall.bin would match the one you put in the all.bin

its an little time comsuming to insert all the hex.

and dont know but got an hunch that it could be DEADBEEF @evilsperm
************* [ - Post Merged - ] *************

@ redcfw
Originally Posted by redcfw View Post

u8 ch73[] = { 0x40, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //?? i dont get it yet
Code:
000365E0  AA F6 5A 91 EC 37 2C 69  09 69 09 0F 59 E5 3C 3E  ¬÷Zæý7,i.i..YÕ<>
000365F0  66 BC B4 17 D1 4A 2B 59  26 40 80 1C 11 B7 B4 9B  f+¦.ÐJ+Y&@Ç..À¦ø
00036600  A5 79 8C 25 43 13 BC 54  16 95 1E 24 EA D3 C9 85  Ñyî%C.+T.ò.$ÛË+à
00036610  2F F2 36 15 2A 47 76 DA  D3 9B 50 92 44 E8 F5 C2  /=6.*Gv+ËøPÆDÞ§-
00036620  FF FF FF FF 00 00 00 00  00 00 00 01 00 00 00 01  ****............
00036630  FF FF FF FF 00 00 00 07  00 00 00 06 00 00 00 02  ****............
00036640  00 00 00 02 00 00 00 00  00 00 00 00 00 00 00 00  ................
00036650  FF FF FF FF 00 00 00 30  00 00 00 20 00 00 00 20  ****...0... ...
00036660  00 00 00 10 00 00 00 00  00 00 00 00 00 00 00 00  ................
00036670  00 00 00 00 FF FF FF F0  00 00 00 00 00 00 00 00  ....****........
00036680  62 7C B1 80 8A B9 38 E3  2C 8C 09 17 08 72 6A 57  b|¦Çè¦8Ò,î...rjW
00036690  9E 25 86 E4 00 00 00 00  00 00 00 00 00 00 00 00  ×%åõ............
se the last two lines
Code:
00036680  62 7C B1 80 8A B9 38 E3  2C 8C 09 17 08 72 6A 57  b|¦Çè¦8Ò,î...rjW
00036690  9E 25 86 E4 00 00 00 00  00 00 00 00 00 00 00 00  ×%åõ............

that is some off the metadata that is in every signed file by sony eboots etc. but not in the appldr from 3.55-
infact it shouldent be in any decrypted file.
so got some thing with the keys.


u8 ch73[] = { 0x40, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
its simply saying the firmware version in this case 4.3
buy the way i allready tried these keys myself, didnt work you have to reverse it longer back.

Thats why i use the openssl to test.
__________________

Last edited by zadow28; 10-27-2012 at 08:48 AM.
zadow28 is offline   Reply With Quote
Likes: (3)
Old 10-27-2012   #465
zxz0O0
Apprentice
 
Join Date: Oct 2012
Location: Switzerland
Posts: 13
Likes: 4
Liked 11 Times in 5 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
redcfw, have you tested it? I tested with lv2ldr and it didn't seem to work.
zxz0O0 is offline   Reply With Quote
Old 10-27-2012   #466
BuC-ShoTz
 
Join Date: Oct 2011
Posts: 21
Likes: 22
Liked 8 Times in 5 Posts
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
Originally Posted by zxz0O0 View Post
redcfw, have you tested it? I tested with lv2ldr and it didn't seem to work.
long time no talk bro

ive found the same thing, the 1st and the 3rd key seems like it decrypts the erks,
the 2nd and 4th keys decrypt the rivs
im still trying to confirm its aes, and also the CypherMode, now if that is a sha1 hash in redcfw's post, im inclined to think its aesctr,
for instance retail pkg's use aesctr

************* [ - Post Merged - ] *************
now that i look at more at redcfw's post,

is ch73 the resulting hmac?, looks good recfw, thank you

Last edited by BuC-ShoTz; 10-27-2012 at 11:22 AM.
BuC-ShoTz is offline   Reply With Quote
Likes: (2)
Old 10-27-2012   #467
zxz0O0
Apprentice
 
Join Date: Oct 2012
Location: Switzerland
Posts: 13
Likes: 4
Liked 11 Times in 5 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Originally Posted by BuC-ShoTz View Post
now that i look at more at redcfw's post,

is ch73 the resulting hmac?, looks good recfw, thank you
Nice to see you here.

According to recfw's code, hmac is in ch73 (which was [u8 ch73[] = { 0x40, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //?? i dont get it yet] before he edited his post) and result stored in
u8 ch73shErk[0x10] and ch73shIv[0x10];

Tried with lv2ldr, result is 3da56b9b349048917aa86511f9651f122ac5a6756b6899fc828b305b5cd0ddda88d4d3a54efaa744e2fee5de543da0d7
zxz0O0 is offline   Reply With Quote
Old 10-27-2012   #468
diesel701
Member
 
diesel701's Avatar
 
Join Date: Aug 2012
Posts: 116
Likes: 15
Liked 19 Times in 14 Posts
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
So... where are the keys? :P I'm not good on coding but I think that we can try the algo and see if we get keys.. or not?
diesel701 is offline   Reply With Quote
Old 10-27-2012   #469
loike
Apprentice
 
Join Date: Apr 2012
Posts: 19
Likes: 0
Liked 7 Times in 3 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
I'm trying to compile the code from naehwert, but I keep getting the following error:

/usr/include/sys/types.h:9:27: sys/sys_types.h: No such file or directory

Do we have to use a certain Sony SDK?
loike is offline   Reply With Quote
Old 10-27-2012   #470
zadow28
Member
 
Join Date: Dec 2011
Posts: 360
Likes: 235
Liked 857 Times in 185 Posts
Mentioned: 188 Post(s)
Tagged: 0 Thread(s)
use my ssl command it does exactly the same thing as the pastie.
__________________
zadow28 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



PS3Hax.net is Copyright © 2010-2013.
Use of this site is governed by our Terms of Use and Privacy Policy. All Trademarks and images are owned by their respected owners.
Posts and links are subject to each author on this forum and are no way affiliated with the operations and/or opinions of ps3hax.net
All times are GMT -5. The time now is 05:03 AM.