Serial/keygen input system applescript 1.0

Hi, This Might Help If Your Looking For A Serial Input System For A Xcode applescript application or just a applescript?.. I’ve Made This So Half The Work Is Done Already!

I’m Working On Updating The Applescript So The Serial Can Be Saved In Excryupted Format So Its Not Readable But The Application Can… (If You Have Any Ideas Or Extra Code Well Let Me Know! :smiley: )

WARNING!: THIS CAN BE HACKED! BECAUSE THE APPLESCRIPT SOURCE CODE IS UP FOR THE WORLD TO SEE SO MODIFY IT SO ITS MORE COMPLEX!!.. EMAIL ME IF YOU WANT ME TO CHECK THE CODE YOU MADE AND I’LL CHECK IT IF YOUR GOING TO USE THIS CODE DON’T PUT A UPDATED VERSION UP UNLESS YOU WANT IT TO BE EXPOILTED!!

Thanks, Taylor Harrison

set userKO to false

repeat until userKO
	--set to checking_A
	set uiReturned to display dialog "Enter serial number" default answer "" buttons {"Cancel", "Check Serial..."} default button 1 with icon note
	set the user_inputcheck to the button returned of the result
	if the user_inputcheck is "Cancel" then
		exit repeat
	end if
	--return false
	if the user_inputcheck is "Check Serial..." then
		--return false
		if text returned of uiReturned = "123-A-APP-SCRPT" then
			say "You Have Successfully Activated This Application.. Enjoy!" using "alex"
			display dialog "You Have Successfully Activated This Application, Enjoy!" buttons {"Close Me, Thanks!"} default button 1 with icon note
			--if the user_inputcheck is "Close Me, Thanks!" then
			--	close
			exit repeat
			-- ENTER THE CODE HERE TO WHAT YOU WANT YOUR PROGRAM TO DO AFTERWARDS
			-- THIS WILL WORK ON XCODE APPLESCRIPT PROJECTS!! 
			(*
			ENTER HERE!
			*)
		else
			if text returned of uiReturned is not "123-A-APP-SCRPT" then
				say "Remember It's Against The Law To Pirate Software" using "alex"
				display dialog "Invaild Serial!, Don't Pirate This Software Because I Will Catch You!" buttons {"Close Me!"} default button 1 with icon note
				--if the user_inputcheck is "Close Me!" then
				--close
				exit repeat
			end if
		end if
	end if
end repeat
end
end
end
-- Made By Taylor J. Harrison On 10.12.10 
-- Email: AudialRedux@hotmail.com (If You Want To Know Me :D ) 

Model: Macbook 10.6.5
Browser: Firefox 3.6.3
Operating System: Mac OS X (10.6)

UPDATE!!! THIS CODE A WASTE OF TIME IF YOUR A PROFESSIONAL APPLESCRIPT XCODE PROGRAMMER… (THIS IS FOR THE NOOBS AHAHAHAHAH) EXAMPLE ONLY!

For more curious,

This is a certain way to encrypt and decrypt using a key. The key must be used te decrypt and is case sensitive. Also this is a small size key but the concept of most security systems is like this. Without knowing anything about code still a computer programm can decrypt this is an couple of hours. So encrypting every value with a differnt key would increase the hack time and encrypting multiple times with different key lengts equals long keys what also increase the hacktime.

encrypt("thiskey", "Hello World!") --result: %wEOJ(2SJEG>
decrypt("thiskey", "%wEOJ(2SJEG>") --result: Hello World!

on encrypt(theKey, theString)
	set keyPosition to 1
	set encryptedString to ""
	considering case
		set alphabet to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .?!,_-!@#$%^&*()+=[]|/?><~±§"
		repeat with aChar in theString
			set ChangeValue to offset of (character keyPosition of theKey as string) in alphabet
			set switchedChar to ChangeValue + (offset of aChar in alphabet)
			if switchedChar > length of alphabet then
				set switchedChar to switchedChar - (length of alphabet)
			end if
			
			set encryptedString to encryptedString & item switchedChar of alphabet
			
			if keyPosition is length of theKey then
				set keyPosition to 1
			else
				set keyPosition to keyPosition + 1
			end if
		end repeat
	end considering
	return encryptedString
end encrypt

on decrypt(theKey, theString)
	set keyPosition to 1
	set encryptedString to ""
	considering case
		set alphabet to "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .?!,_-!@#$%^&*()+=[]|/?><~±§"
		repeat with aChar in theString
			set ChangeValue to offset of (character keyPosition of theKey as string) in alphabet
			set switchedChar to (offset of aChar in alphabet) - ChangeValue
			if switchedChar < 0 then
				set switchedChar to switchedChar + (length of alphabet)
			end if
			
			set encryptedString to encryptedString & item switchedChar of alphabet
			
			if keyPosition is length of theKey then
				set keyPosition to 1
			else
				set keyPosition to keyPosition + 1
			end if
		end repeat
	end considering
	return encryptedString
end decrypt

Wouldn’t a SQL database with information related to the key help instead of having one set key on there?
So a user can be called by their name because the key was registered under their name.

Less information stored on the computer… more on the cloud, so you don’t loose any.
I need to learn SQL soon. :smiley:

-- Serial Input System v1.1
-- Copyright (C) 2011 AudialRedux 

set userKO to false

repeat until userKO
  
   set uiReturned to display dialog "Enter serial number" default answer "" buttons {"Cancel", "Check Serial..."} default button 1 with icon note
   set the user_inputcheck to the button returned of the result
   if the user_inputcheck is "Cancel" then
       exit repeat
   end if
   
   if the user_inputcheck is "Check Serial..." then
       --return false
       set SerialNumber to "123-A-APP-SCRPT"
       if text returned of uiReturned = SerialNumber then
           try 
           do shell script "echo 'DONE!.' >> /tmp/2311238043.dat" --Set's Serial In Temp Folder 
           end try 
          
           say "You Have Successfully Activated This Application.. Enjoy!" using "alex"
           
           display dialog "You Have Successfully Activated This Application, Enjoy!" buttons {"Close Me","Thanks!"} default button 1 with icon note
           if the button returned is "Close Me" then
           try 
           close
           end try 
           exit 
           exit repeat
           -- ENTER THE CODE HERE TO WHAT YOU WANT YOUR PROGRAM TO DO AFTERWARDS
           -- THIS WILL WORK ON XCODE APPLESCRIPT PROJECTS!! 
           (*
           ENTER HERE!
           *)
       else
           if text returned of uiReturned is " " then
if text returned of uiReturned = " " then
               say "Nothing Was Entered, Please Try Again?" using "alex"
               display dialog "Invaild Serial!" buttons {"Close Me!"} default button 1 with icon note
               --if the user_inputcheck is "Close Me!" then
               --close
               exit repeat
           end if
       end if
   end if
if text returned of uiReturned is not "123-A-APP-PRIATED" then
say "Pirated Serial" using "Alex"
end if 
end repeat
end
end

Sorry people there was an error in pirated serial coding but its now fixed

CHANGE LOG.
*Fixed Pirated Coding
*Added None Input Coding (Notifice If Nothing In The Text Box)
*Fixed Buttons? (I Think?)


--- Serial Input System v1.2 
-- Copyright (C) 2011 Audialredux 
set userKO to false

repeat until userKO

set uiReturned to display dialog "Enter serial number" default answer "" buttons {"Cancel", "Check Serial..."} default button 1 with icon note
set the user_inputcheck to the button returned of the result
if the user_inputcheck is "Cancel" then
exit repeat
end if

if the user_inputcheck is "Check Serial..." then
--return false
set SerialNumber to "123-A-APP-SCRPT"
if text returned of uiReturned = SerialNumber then
try 
do shell script "echo 'DONE!.' >> /tmp/2311238043.dat" --Set's Serial In Temp Folder 
end try 

say "You Have Successfully Activated This Application.. Enjoy!" using "alex"

display dialog "You Have Successfully Activated This Application, Enjoy!" buttons {"Close Me","Thanks!"} default button 1 with icon note
if the button returned is "Close Me" then
try 
close
end try 
exit 
exit repeat
-- ENTER THE CODE HERE TO WHAT YOU WANT YOUR PROGRAM TO DO AFTERWARDS
-- THIS WILL WORK ON XCODE APPLESCRIPT PROJECTS!! 
(*
ENTER HERE!
*)
else
if text returned of uiReturned is " " then
if text returned of uiReturned = " " then
say "Nothing Was Entered, Please Try Again?" using "alex"
display dialog "Invaild Serial!" buttons {"Close Me!"} default button 1 with icon note
--if the user_inputcheck is "Close Me!" then
--close
exit repeat
end if
end if
end if
if text returned of uiReturned is "123-A-APP-PRIATED" then
say "Pirated Serial" using "Alex"
end if 
end repeat
end
end