Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
on keyDown pKey
if the length of me <= 10 then
put "*" after me
put pKey after fld "hidden_psw1"
else
// If there are 5 or more characters in the field
// beep and prevent text entry
//beep
end if
end keyDown
My example stack has two fields: the one an end-user might see on-screen showing blobs, and
an off-screen field that might end up containing the actual password for the stack to use.
The only real reason for the on-screen field is so that:
1. The end-user knows s/he has entered a sufficient number of characters.
2. The end-user gets a "warm fuzzy".
as from a programming point of view it is not necessary at all.
on keyDown pKey
if the length of me >= 5 then
// If there are 5 or more characters in the field
// beep and prevent text entry
beep
else
pass keyDown
lock screen
put the last char of me after fld "hidden_psw1"
set the text of the last char of me to numToCodePoint(9679)
unlock screen
end if
end keyDown
the easiest was is to load one of the free TTF "Password" fonts from the net and use this for your password field. Add this to your standalone and "start using font file "path_to_password.ttf".
Surely a Password font simply consists of a font with a blob in every position: if so anyone with half a brain
only has to copy-paste the string somewhere else and change the font to see the password.
richmond62 wrote: Tue Oct 31, 2017 7:15 pm
Surely a Password font simply consists of a font with a blob in every position: if so anyone with half a brain
only has to copy-paste the string somewhere else and change the font to see the password.
Yes, and again, you, as a developer, have to prevent this, maybe by cathing the "pastekey".
richmond62 wrote: Tue Oct 31, 2017 7:15 pm
Surely a Password font simply consists of a font with a blob in every position: if so anyone with half a brain
only has to copy-paste the string somewhere else and change the font to see the password.
Yes, and again, you, as a developer, have to prevent this, maybe by cathing the "pastekey".
Trevor's lesson linked above does include info related to preventing copy of the password field text. It is correct to think there is more to it than just changing the letters to identical blobs.
Klaus wrote: Tue Oct 31, 2017 7:55 pm...
Yes, and again, you, as a developer, have to prevent this, maybe by cathing the "pastekey".
Trevor's lesson linked above does include info related to preventing copy of the password field text. It is correct to think there is more to it than just changing the letters to identical blobs.
Yep, maybe I should have been writing: ...have to prevent this, maybe by reading Trevors above mentioned lesson.