A method (800, 900, 1000, 11000) for encoding, implemented by an encoding terminal (102, 300), of a biometric template (803, 903, 1003, 1103) for testing (GE-Bio), said method takes, as input data, a biometric characteristic (801, 901, 1001, 11001) for testing (CE-Bio), and provides, as output data, a biometric template (803, 903, 1003, 1103) for testing (GE-Bio), in which the biometric template (803, 903, 1003, 1103) for testing (GE-Bio) is generated from the biometric characteristic (801, 901, 1001, 1101) of test (CE-Bio) according to an encoding scheme (802, 902, 1002, 1102) representative of the distance (802a, 902a, 1002a, 11002a), d(CE-Bio, CR-Bio), according to a metric between the biometric characteristic (801, 901, 1001, 1101) of test (CE-Bio) and a biometric characteristic (802b, 902b, 1002b, 1102b) of reference (CR-Bio).