1

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?

marked as duplicate by eth Nov 20 '16 at 1:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.