The invention concerns a method for protecting data in a device comprising a microprocessor having at least a debug register. The invention is characterised in that the method comprises an operation which consists in assigning a debug register to the data to be protected (301). Preferably, the inventive method comprises, for each break triggered by a debug register assigned to protected data, an operation for verifying (302, 303) validity of access.
展开▼