B4R Question EEPROM protection

Mostez

Well-Known Member
Licensed User
Longtime User
Hello,
I have some stored data on Mega 2560 EEPROM, like username, password and other settings. is it possible to protect EEPROM against data reading or simply burn small software on arduino and pull everything out from EEPROM?

Thanks
 

Mostez

Well-Known Member
Licensed User
Longtime User
are there any examples about how to obfuscate data? and how to remove the bootloader?
Thanks
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Search google about removing the boot loader.

Simple obfuscation:
B4X:
Private Sub AppStart
   Serial1.Initialize(115200)
   Log("AppStart")
   Dim bc As ByteConverter
   Dim data() As Byte = bc.HexToBytes("0001020304")
   ObfuscateArray(data)
   Log(bc.HexFromBytes(data))
   DeobfuscateArray(data)
   Log(bc.HexFromBytes(data))
End Sub

Sub ObfuscateArray(data() As Byte)
   For i = 0 To data.Length - 1
     data(i) = Bit.Xor(data(i), 0x49)
   Next
End Sub

Sub DeobfuscateArray(data() As Byte)
   ObfuscateArray(data)
End Sub

You need to obfuscate the data before you write it and deobfuscate it after you read it.
 
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
LB1 and LB2 control access to flash from an external programmer.

BLB01 and BLB02 control read/write access to the Application Section from the Boot Loader section.

BLB11 and BLB12 control read/write access to the Boot Loader section from the Application Section.
You should program those fuses to void any kind of hacking
 
Upvote 0
Top