Is it possible to lock command, protect cloning or not erasable by other app for MIFARE card 1k

You can t protect a card to be replicate on herself. (A force brut method is easy to apply on this technologie)

What is possible to do is a hash of all block including UID that you store on the card.In your programm you just compare data hash with the hash stored.

To realise your very basic hash in python and store it in a block, you can use double pseudo random:

def CRYPT_hashage(data,UID):
    seed(str(data)+str(UID))
    seed(random())
return str(random()).replace("0.","")[:8]

It prevent from clonning on another card. The user still can modify it own card. But you can hash the 'sensitives' data with the same technique.

After theses 2 securities, it left only the "cloning on herself" technique, for example: - You copy your datas - You pay (for a cashless paiement system) - You paste your olds datas on your card)

The only way to prevent it is to store all datas on a server using only the UID of the card as a primary key.

There exist card that you can change UID.