I mean, if I have a contract with function like:

string current_password;
function set_password(string password, string new_password) {
    if (password == current_password) {
        current_password = password;

Is it ok to call set_password just as it is, without any ecryption? I'm asking because in my understanding every miner node, which receiveing this transaction is able to read all the data, so it's pretty dangerous to use this code.

And if I'm right, how can I prevent this? Maybe there are some techniques or patterns of secure contract development?


Browse other questions tagged or ask your own question.