Skip to content

transcend-information/RaspberryPi-SDcard-Security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This document provides a way to use the LOCK / UNLOCK command (CMD42) and Secure Erase via Transcend RDF5 Card Reader on Raspberry Pi / NVIDIA Jetson Nano.

After the host sets the password and sends it to the card, the card will be locked. Data will be read and write protected, and can be viewed and changed only by entering the correct password. Where an incorrect password is provided, the card will remain locked.

A password-protected card will be automatically locked after power reset. To permanently unlock a card, please remove the password.

Note : The project works for Transcend Embedded microSD / SD products with the RDF5 Card Reader.

Hardware requirements

  1. Supported Platform

    • Raspberry Pi 4 or later
    • NVIDIA Jetson Nano
  2. Supported SD cards

    • Transcend Embedded microSD 430T / 450I / 460I / 460T / 465T
    • Transcend Embedded SD SDC460T / SDC400I / SDC240T
  3. Supported Card Reader

    • Transcend RDF5

Compile the executable file

Go to the project folder and use the command line below to build an executable file named 'sdsecure'.

gcc main.c libscsi.c -o sdsecure

Usage with the RDF5 Card Reader

Please change the < device > parameter by the USB card reader device. ex. /dev/sda
Note:The following functions have to work with Transcend RDF5 card reader.

Lock/Unlock SD card

  1. Set password for SD card
sudo ./sdsecure --set-pwd <Password> <device>

alt text

  1. After setting the password, lock SD card with the password
sudo ./sdsecure --lock <Password> <device>

alt text

  1. Quick-lock command : replace the steps of setting the password and locking the SD card. The SD card will be locked immediately.
sudo ./sdsecure --quick-lock <Password> <device>

alt text

  1. Unlock the SD card with the password
sudo ./sdsecure --unlock <Password> <device>

alt text

  1. Remove the password of the SD card using the following command.
sudo ./sdsecure --clear <Password> <device>

alt text

Secure Erase SD card

Force erase all data on the SD card

sudo ./sdsecure --erase <device>

alt text

Check SD card status

sudo ./sdsecure --status <device>

alt text