A data processing apparatus secures data from third parties in event of
power loss by utilizing a backup power supply to provide power while data
is erased from memory. The data is stored in a nonvolatile memory. A
first voltage supply unit supplies voltage to the memory, and a second
voltage unit supplies voltage to the memory when the first voltage supply
unit is incapable of supplying voltage to the memory. When the first
voltage supply unit becomes incapable of supplying voltage to the memory,
the memory is controlled to erase the data stored therein using a
selected one of a plurality of erasing processes depending on the status
of processing of the data.