All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: why flash manufacturers encrypt chips?
PostPosted: October 16th, 2022, 20:40 
Offline

Joined: November 12th, 2018, 13:34
Posts: 19
Location: estonia
i heard stories that flash manufacturers factory encrypt their chips and making data recovery.
is there any reason why some manufacturers encrypt their chips..what does it give them?


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 17th, 2022, 1:20 
Offline

Joined: October 24th, 2009, 15:22
Posts: 897
Location: Poland
You mean encryption or scrambling (xoring data)?

_________________
Flash Killer - everyday new resources (pinout, XOR, ECC,config) for flash devices


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 17th, 2022, 19:30 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
Maybe for same reason hard drive manufacturers do this.

Also I have been wondering if encryption accomplishes the same as XOR scrambling.. XOR scrambling serves a purpose, say increase of entropy. Could encryption do the same?

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 18th, 2022, 0:29 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 16021
Location: Australia
FDE typically uses AES. A sector full of zeros, after encryption, is filled with a repeating pattern of 16 bytes. Those 16 bytes have high entropy, but the sector does not (or does it?).

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 18th, 2022, 6:38 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
fzabkar wrote:
FDE typically uses AES. A sector full of zeros, after encryption, is filled with a repeating pattern of 16 bytes. Those 16 bytes have high entropy, but the sector does not (or does it?).


Ah, good to know. That would answer my question then I guess with 'no'. So then I suppose these manufactures apply both encryption on top or after some kind of scrambling?

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 19th, 2022, 12:48 
Offline

Joined: October 3rd, 2005, 0:40
Posts: 4486
Location: Hungary
Quote:
is filled with a repeating pattern of 16 bytes.


only if AES-ECB is used, but there are ways to do it better, like AES-CBC , CFB, etc, so it would result in a high-entropy data block.
pepe

_________________
Adatmentés - Data recovery


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 20th, 2022, 5:13 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
pepe wrote:
Quote:
is filled with a repeating pattern of 16 bytes.


only if AES-ECB is used, but there are ways to do it better, like AES-CBC , CFB, etc, so it would result in a high-entropy data block.
pepe


Interesting.

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 22nd, 2022, 17:13 
Offline

Joined: December 13th, 2020, 18:47
Posts: 74
Location: recoverland
Arch Stanton wrote:
Maybe for same reason hard drive manufacturers do this.

Also I have been wondering if encryption accomplishes the same as XOR scrambling.. XOR scrambling serves a purpose, say increase of entropy. Could encryption do the same?


I don't understand why a XOR operation increases entropy. Could you explain?

As for your encryption question the answer is yes if you use the right mode, see here:
https://github.com/pakesson/diy-ecb-penguin


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 22nd, 2022, 17:34 
Offline

Joined: December 13th, 2020, 18:47
Posts: 74
Location: recoverland
fzabkar wrote:
FDE typically uses AES. A sector full of zeros, after encryption, is filled with a repeating pattern of 16 bytes. Those 16 bytes have high
entropy, but the sector does not (or does it?).


The sector could be compressed easily without loss. That is low entropy on sector level and above.
I wonder if one would apply the term entropy on a 16 byte pattern only...


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 22nd, 2022, 17:38 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
rec wrote:
Arch Stanton wrote:
Maybe for same reason hard drive manufacturers do this.

Also I have been wondering if encryption accomplishes the same as XOR scrambling.. XOR scrambling serves a purpose, say increase of entropy. Could encryption do the same?


I don't understand why a XOR operation increases entropy. Could you explain?

As for your encryption question the answer is yes if you use the right mode, see here:
https://github.com/pakesson/diy-ecb-penguin


Maybe I should have avoided that word, but if we XOR block of zeros with XOR key or block, do we not increase entropy? AIUI storing very similar data close is more prone to corruption and to avoid this XOR is applied to introduce noise and avoid worst case patterns. I assumed this increase in noise leve translates to high Shannon entropy. But I am no expert on the matter, it's what I read everywhere (NAND Flash Data Recovery Cook Book and other places / documents). If we look at typical XOR-ed block of repeating bytes in VNR we see

Attachment:
xor-block.png
xor-block.png [ 200.47 KiB | Viewed 9038 times ]


Which seems to me higher entropy data than a repeating pattern. If the same is already accomplished by some form of encryption XOR scrambling seems like an un-needed extra step. So maybe reasoning is, encryption gives us required noise AND we can position/market encryption as a feature. I do not know, I am simply guessing, thinking out loud.

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 23rd, 2022, 7:45 
Offline

Joined: December 13th, 2020, 18:47
Posts: 74
Location: recoverland
Based on the pictures shown I guess that you are doing the XOR operation with a varying source and not with any byte value.


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 23rd, 2022, 7:55 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
I have no idea what this means or what you mean to tell by it.

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 23rd, 2022, 11:14 
Offline

Joined: December 13th, 2020, 18:47
Posts: 74
Location: recoverland
The pictures to the right look like noise to my eye. It looks as if the content of all bytes are equally distributed. I assume that compression would no be able to reduce the size of the underlying files.

Now look at my two sentences above in ASCII-code. XORing each byte with a fixed value from the range [0:255] will certainly modify the appearance but will not affect the form of the distribution. The most frequent letter will be represented by a different value but will represented as often as before performing the XOR operation.


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 23rd, 2022, 11:27 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
Depends on what you pick to XOR with, you assume everything is xor-ed with same byte or am I mistaking?

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 23rd, 2022, 11:30 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
you really don't get my point about introducing 'noise' or are you just fucking about?

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 23rd, 2022, 12:52 
Offline

Joined: December 13th, 2020, 18:47
Posts: 74
Location: recoverland
Arch Stanton wrote:
Depends on what you pick to XOR with, you assume everything is xor-ed with same byte or am I mistaking?


Yes, that is correct.

Arch Stanton wrote:
you really don't get my point about introducing 'noise' or are you just fucking about?


I am asking the question because I get the idea but I wonder how running a byte-wise XOR should introduce noise.


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 23rd, 2022, 16:04 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
AIUI NAND uses 'XOR keys'. Let's XOR a low entropy pattern xFF xFF xFF xFF with 'key' x12 x34 x56 x78, we get xED xCB xA9 x87. If we use 512 byte XOR key we introduce noise or entropy in low entropy blocks.

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 24th, 2022, 6:20 
Offline

Joined: December 13th, 2020, 18:47
Posts: 74
Location: recoverland
I agree. And what you did even corresponds to one-time pad encryption.

But I was thinking about taking a drive sector and XOR it with 'key' x12 x34 x56 x78.
That does not really increase entropy.


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: October 24th, 2022, 6:41 
Offline
User avatar

Joined: May 13th, 2019, 7:50
Posts: 991
Location: Nederland
rec wrote:
I agree. And what you did even corresponds to one-time pad encryption.

But I was thinking about taking a drive sector and XOR it with 'key' x12 x34 x56 x78.
That does not really increase entropy.


Since you assumed XOR-ing every byte with same byte over and over I gave 4 byte example. I could also have given 8 byte, or 16 byte or 256 byte example but was too lazy and figured you'd get the idea. If you need entropy in larger block you use bigger XOR key.

_________________
Joep - http://www.disktuna.com - video & photo repair & recovery service


Top
 Profile  
 
 Post subject: Re: why flash manufacturers encrypt chips?
PostPosted: November 17th, 2022, 8:28 
Offline
User avatar

Joined: December 4th, 2012, 1:35
Posts: 3855
Location: Adelaide, Australia
There are research papers on this stuff you can read.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group