how to verify the user's entered password in GUI pop-up window?

1 次查看(过去 30 天)
hi everyone. I'm new in Matlab. I have a question here: I have already create a pop-up window which ask user to type in password and re-type the password.The retype passwords is to verify whether the re-type passwords same with the initial password. can anyone teach me how to d it? thanks

回答(1 个)

Jan
Jan 2012-3-31
It sounds trivial: Use strcmp or isequal to compare both strings. If they are different, repeat the password input dialog.
I assume you have a specific problem. Please post the current code and explain what you want to have changed.
However, password protection is a extremely tricky process. Inside an M- or P-file a cheating is trivial. Never store passwords in clear text, because it is very easy to extract them from the function. Better use a hash, e.g. MD5 or SHA-256. And then add "salt" to the password to make a decryption too expensive.

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by