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?
You cannot lock the EEPROM. You can obfuscate the data. You can also remove the bootloader from the Arduino to make it more complicate to burn a new program.
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.