Page 1 of 2 12>
Topic Options
#113560 - 2004-02-07 04:04 PM How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Hi,

Wonder how to force user to validate and enter a password using kixforms GUI before execute a kix script.

Any good tips?

/Cy

_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113561 - 2004-02-07 04:07 PM Re: How to password protect a script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
Create a KiXforms form with two text input objects, one of them in password mode. Upon valid data entry launch the separate KiXtart script.
_________________________
There are two types of vessels, submarines and targets.

Top
#113562 - 2004-02-07 04:15 PM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
what do u meen with "password mode"? is it a buildin mode state? if so, how do i call it then?

Once the user enter his/her password it sould be "*******" in the passwd textbox. How do i make it hide the input passwd?


_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113563 - 2004-02-07 04:52 PM Re: How to password protect a script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
See the KiXforms Manual under the TextBox object and the PasswordChar property.
_________________________
There are two types of vessels, submarines and targets.

Top
#113564 - 2004-02-08 12:39 AM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
It works fine. thnx a lot \C
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113565 - 2004-03-18 05:51 PM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
I want the authentication script to be in the same script, insted of call and launching the secound script if authentication is OK. I try using goto and gosub to make it run the rest of script if passwd is ok. But its not working.
.
.
$PSWB.OnClick = "PasswdC()"

Function PasswdC()
.
.
Endfuction

:Start (run the script if passwd ok)
.
.
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113566 - 2004-03-18 05:55 PM Re: How to password protect a script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
You don't show any code. Never use GOTOs!
_________________________
There are two types of vessels, submarines and targets.

Top
#113567 - 2004-03-18 06:39 PM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Sorry, Here is the code:

$=SetConsole("minimize")

Break On
;Dim $Form
$Form = CreateObject("Kixtart.FORM")
$Form.CAPTION = "Authentication for @FULLNAME"
$Form.SCALEWIDTH = 300
$Form.SCALEHEIGHT = 60
$Form.FONTSIZE = 8
$Form.FONTNAME = "Verdana"
$Form.PrintXY(15,6,"Enter authenticity Key and press Button")
$Form.CENTER

$txtpassword = $form.textbox("",15,30,100,20)
$txtpassword.passwordchar = "*"
$txtpassword.text = ""
$PSWB = $form.Button("Validate",125,30,100,20)
$PSWB.OnClick = "PasswdC()"

$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents())
;Loop
Exit 1

Function PasswdC()

If $txtpassword.text = 'validate'
Dim $Form
$Form = CreateObject("Kixtart.FORM")
$Form.CAPTION = "Done!"
$Form.SCALEWIDTH = 325
$Form.SCALEHEIGHT = 30
$Form.FONTSIZE = 10
$Form.FONTNAME = "Verdana"
$Form.PrintXY(10,6,"Passwd OK")
$Form.CENTER
$Form.Show
Sleep 3
; (Somewhere here i want to jump to start of secound script)
Else Dim $Form1
$Form1 = CreateObject("Kixtart.FORM")
$Form1.CAPTION = "Faild"
$Form1.SCALEWIDTH = 325
$Form1.SCALEHEIGHT = 30
$Form1.FONTSIZE = 10
$Form1.FONTNAME = "Verdana"
$Form1.PrintXY(10,6,"Wrong code")
$Form1.CENTER
$Form1.Show
Sleep 3
EndIf
Exit
;(Here i will to give the user one more chance or make it exit the script)
EndFunction

; (Here will the secound script begins, if Authentication is OK )
Break On

$Form = CreateObject('Kixtart.Form')
$Form.BackColor = 212,208,200
$Form.ControlBox = "True"
$Form.DrawGrid = "True"
$Form.FontBold = "False"
$Form.FontItalic = "False"
$Form.FontName = "Tahoma"
$Form.FontSize = 8
$Form.FontUnderline = "False"
$Form.ForeColor = 0,0,0
$Form.FormBorderStyle = 3
$Form.Height = 580
$Form.Left = 11
$Form.MaximizeBox = "False"
$Form.MinimizeBox = "True"
$Form.SizeGripStyle = 2
$Form.StartPosition = 4
$Form.Tag = ""
$Form.Text = "My Script"
$Form.Top = 3
$Form.ToolTipText = ""
$Form.TopMost = "False"
$Form.Width = 800
$Form.WindowState = 0
.
.
.



Edited by Cyrus (2004-03-18 06:41 PM)
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113568 - 2004-03-19 11:30 AM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Jens, need your help on this one too.
Could u please check the code and see what Im doing wrong or how should i do?

Thanx
/C
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113569 - 2004-03-19 03:53 PM Re: How to password protect a script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
I'd completely rewrite the whole thing along these liens:
Code:

$=SetConsole("minimize")

Break On
;Dim $Form
$Form = CreateObject("Kixtart.FORM")
$Form.CAPTION = "Authentication for @FULLNAME"
$Form.SCALEWIDTH = 300
$Form.SCALEHEIGHT = 60
$Form.FONTSIZE = 8
$Form.FONTNAME = "Verdana"
$Form.PrintXY(15,6,"Enter authenticity Key and press Button")
$Form.CENTER

$txtpassword = $form.textbox("",15,30,100,20)
$txtpassword.passwordchar = "*"
$txtpassword.text = ""
$PSWB = $form.Button("Validate",125,30,100,20)
$PSWB.OnClick = "PasswdC()"

$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents())
Loop
$Form=0
IF not $authenticated
exit 2
endif

; do the main form
; (Here will the secound script begins, if Authentication is OK )
Break On

$Form = CreateObject('Kixtart.Form')
$Form.BackColor = 212,208,200
$Form.ControlBox = "True"
$Form.DrawGrid = "True"
$Form.FontBold = "False"
$Form.FontItalic = "False"
$Form.FontName = "Tahoma"
$Form.FontSize = 8
$Form.FontUnderline = "False"
$Form.ForeColor = 0,0,0
$Form.FormBorderStyle = 3
$Form.Height = 580
$Form.Left = 11
$Form.MaximizeBox = "False"
$Form.MinimizeBox = "True"
$Form.SizeGripStyle = 2
$Form.StartPosition = 4
$Form.Tag = ""
$Form.Text = "My Script"
$Form.Top = 3
$Form.ToolTipText = ""
$Form.TopMost = "False"
$Form.Width = 800
$Form.WindowState = 0

sleep 10

Function PasswdC()

If $txtpassword.text = 'validate'
$Authenticated = 1
EndFunction




there are other ways to do thsi, e.g. initializing the KiXforms system first, then create the password prompt. If success create the main form else display a messagebox and exit.
_________________________
There are two types of vessels, submarines and targets.

Top
#113570 - 2004-03-19 04:06 PM Re: How to password protect a script?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Maybe I'm missing something, but what is the point of password protecting a script if the user can edit the script and read or bypass the password? That, to me, is just security by ignorance.

I would opt for another approach. Setup a resource that the user needs to authenticate against and put the second script in that resource. If the user fails to authenticate, it is end of story. There is no way for the user to circumvent the security.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#113571 - 2004-03-19 04:15 PM Re: How to password protect a script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
I'm giving up on wondering why people want to do things in a certain (non-secure) way.
_________________________
There are two types of vessels, submarines and targets.

Top
#113572 - 2004-03-19 04:29 PM Re: How to password protect a script?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Security has to be commensurate with what one is securing. You don't protect a $2,000 bike with a $10 lock.

I wonder though, what ppl are thinking when they protect (???) their head with a $10 crash helmet?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#113573 - 2004-03-19 04:41 PM Re: How to password protect a script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
Maybe the contents is only worth $10? How much does some hot air cost nowadays? ;-)
_________________________
There are two types of vessels, submarines and targets.

Top
#113574 - 2004-03-19 04:58 PM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Dont get me wrong. I will compile the script to make a exe file of that. I suppose once its compiled user cannot read the code inside the script. Or mayby Im wrong.... Should I do it in otherway?

Thanx a lot Jens :-)

_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113575 - 2004-03-19 05:05 PM Re: How to password protect a script?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

Or mayby Im wrong



There is no such thing as a KiX compiler (secure or other). All that exist are packagers and their security can easily be defeated.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#113576 - 2004-03-19 05:32 PM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Hummm, That was not good... so what are u then suggesting?
Mayby I could package it and then use Installshield.....

There is always a way :-)
(at least I hope it is)
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113577 - 2004-03-19 05:34 PM Re: How to password protect a script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11163
Loc: Boston, MA, USA
Since we have absolutely no clue at all what exactly you try to do, we won't be able to help you.
_________________________
There are two types of vessels, submarines and targets.

Top
#113578 - 2004-11-17 09:14 PM Re: How to password protect a script?
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Have to admit, Les is right:

Security has to be commensurate with what one is securing. You don't protect a $2,000 bike with a $10 lock.
I wonder though, what ppl are thinking when they protect (???) their head with a $10 crash helmet?

:-)

This case is closed!
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#113579 - 2004-11-17 09:41 PM Re: How to password protect a script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22344
Loc: OK
not really.
no real solutions here yet...
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 289 anonymous users online.
Newest Members
Praveer, Ollero, rayyo, Foxlicht, DonChild
17742 Registered Users

Generated in 0.043 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org