Advice on how to handle using a Micro SD as a key

The project:
Making an over-complicated Hours Meter for my truck.

Equipment:
I'm using an ESP32 Feather/Huzzah32, Micro SD breakout Board, Ultimate GPS Breakout board, DS3231 RTC, and an RGB Character LCD.

Details:
I'm going to use the feather and the RTC to keep track of time sending that data the micro SD every minute. The GPS is going to keep track of movement and separate Idle from moving. Every 120 hours using wifi to send me a text using email to text and my truck internet saying Change my oil. Every 350 moving hours send a text to change my transmission fluid.

I do a lot of towing with my truck and it idles way more than it should.

The Problem:
I want to save the hours data to a micro SD but I want the data to be permanent like a digital miles meter is on a vehicle. So if the sd with the miles information is pulled out and edited to show incorrect information I want the feather to throw an error code.

Can someone give me advice on my problem? Thank you for your time.

Edited to fix spelling, lol

What have you already done? Post your code, in code tags. What does the code actually do? What should the code do?

Provide a schematic.

What have you already done?

Everything except the LCD is connected because I bought a 5v LCD and the feather is 3.3v. I all ready have a solution for this issue.

I have test code for proof of concept for:
Connecting to car wifi.
Sending an email to SMS from feather
Connecting to GPS for speed and distance information.
Writing and reading from the sd

I have lots of Ardunio stuff laying around and connecting to a character LCD and stuff like that is easy as well.

Post your code, in code tags.

I'm not posting test code there is no need.

What does the code actually do?

Details:
I'm going to use the feather and the RTC to keep track of time sending that data the micro SD every minute. The GPS is going to keep track of movement and separate Idle from moving. Every 120 hours using wifi to send me a text using email to text and my truck internet saying Change my oil. Every 350 moving hours send a text to change my transmission fluid.

This was in my first post.

What should the code do?

The Problem:
I want to save the hours data to a micro SD but I want the data to be permanent like a digital miles meter is on a vehicle. So if the sd with the miles information is pulled out and edited to show incorrect information I want the feather to throw an error code.

This was also in my first post.

Provide a schematic.

Why? Everything in all my test works perfectly and how its wired will not inform me on how to make the SD act as a "key". That word may not be a good description but if you read "The Problem" it will tell you what I'm trying to do.

All I'm am asking is someone to point me in the correct direction for the question I asked in my first post under problem.

So if the sd with the miles information is pulled out and edited to show incorrect information I want the feather to throw an error code.

The attached file is a picture of my board. Don't understand what you would want to see it.

The LCD is not attached because I'm waiting on stuff to come in the mail. Im going to connect my 5v Character lcd to a Metro Mini I have and use it as a slave device on my Huzzah32 using SPI and a Logic Level Converter.

That is the only way I can think of on how to connect a 5v 18pin RGB Character LCD to a 3.3 volt device.

OK, two potential problems here are whether you want the information on the card to be validated, and whether you want it to be protected from duplication.

The latter, preventing copying and duplication - is not possible with an SD card.

Validation is performed by using an accepted secure keyed hash algorithm to generate a hash of all the data that is in question, and also writing that hash to the card.

The key to the hash is a secret, kept on the Teensy with the code including that key, protected from being read. The only other place the key would be kept is on a PC used to read the card, clearly not on the card itself. Without the key, it is not possible to generate a hash which actually matches the data.

Do not depend on the SD card being reliable, they do fail, and can do so suddenly. Since you have WiFi access, backing up the data should not be a problem.

With GPS and WiFi available, I wouldn't think an RTC would even be needed, since you can use either of those to obtain the time and keep a software RTC in sync.

The latter, preventing copying and duplication - is not possible with an SD card.

Validation is performed by using an accepted secure keyed hash algorithm to generate a hash of all the data that is in question, and also writing that hash to the card.

So hash is my main choice as of right now, Thank you!

Since you have WiFi access, backing up the data should not be a problem.

My truck internet is running off of cellphone towers. I go to many many places that I get zero signal. I did think of backing up the data to a server but if I’m in a no signal area then that is not possible.

With GPS and WiFi available, I wouldn’t think an RTC would even be needed, since you can use either of those to obtain the time and keep a software RTC in sync

GPS and wifi are external and my RTC is internal. If I have connection issues I will all ways be able to rely on my RTC!

Do not depend on the SD card being reliable, they do fail, and can do so suddenly.

I originally wanted to use the EEPROM but I know that is not a good place to store data. Microsd was a second choice. My thought is the ill just say 8 bytes of data ill be writing every minute should not be a problem spread out over 32 gigs. I hope my MicroSD has wear leveling.

Have you looked at Fram chips ?

Some boards about with them and I2C addressing .

hammy:
Have you looked at Fram chips ?

Some boards about with them and I2C addressing .

https://www.fujitsu.com/us/Images/SPBG_FRAM_Overview_BR.pdf

This is what I want to use!!!!! Thank you so much. Fram chips are perfect for me. I did so much googling nothing like this came up for me. It must have been how I was searching. Thank you.