Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
Yvonne ting
Yvonne ting el 31 de Mzo. de 2012
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

Respuestas (1)

Jan
Jan el 31 de Mzo. de 2012
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.

Community Treasure Hunt

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

Start Hunting!

Translated by