Académique Documents
Professionnel Documents
Culture Documents
SOFTWARE
PROTECTION
AND
LICENSE SECURITY
SDK
User Manual
B AT T L E - P R O V E N S O F T W A R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
SINCE 1992
R E L E A S E D AT E : J A N U A R Y 2 0 0 3
Grant Of Rights
In consideration of payment, CrypKey (Canada) Inc. (CrypKey) grants to the purchasing
company (the Customer) the non-exclusive right to possess, use, and make and distribute
unlimited copies of the machine-executable code version of the CrypKey Software Licensing
System, including all revisions, modifications, and updates thereto furnished to the customer,
together with the written User Manuals in relation thereto (collectively the Software).
Intended Purpose
The Software is intended to be linked with and incorporated into the product, including, but limited
to, the foundation module and installation routines forming a part thereof. No right to distribute the
Software on a stand-alone basis is intended by this License Agreement. Any other use of the
Software requires written consent from CrypKey. The customer may not reverse engineer, modify,
nor create derivative works based on the Software without written consent from CrypKey, except
as permitted by acceptable law.
Ownership
All patents, copyrights, and other proprietary rights in the Software are, and shall remain, the
exclusive property of CrypKey or its suppliers. The Customer may not assign nor transfer the
rights granted in the License Agreement to any person, except the Customers subsidiaries and
affiliates, without written consent from CrypKey.
Limited Warranty
CrypKey warrants to the Customer that the Software will operate essentially as described in
CrypKey brochures and documentation. CrypKey warrants that the media on which the Software
is recorded shall be free from defects in materials and workmanship under normal use and service
for 60 days from the date of the Customers invoice. If failure of the media is a result of accident,
abuse, or misapplication of the Software, CrypKey shall not be responsible for its replacement.
Applicable law may imply warranties that cannot be excluded or can be excluded only to a limited
extent. This Agreement shall be reached and construed subject to such laws.
No Other Warranties
THE LIMITED WARRANTY SET FORTH HEREIN IS IN LIEU OF, AND CRYPKEY
DISCLAIMS, ANY AND ALL OTHER WARRANTIES (EXPRESS OR IMPLIED) WITH
RESPECT TO THE SOFTWARE, INCLUDING ANY AND IMPLIED WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Remedies
Except in connection with a claim for infringement of copyright, patent, or other
intellectual property right, the Customers sole and exclusive remedy for a breach of
warranty shall be: (a) the return of the initial fee paid for the rights granted herein or (b)
the correction or replacement of defective software or media. Corrected or replaced
Software or media will be warranted to the same extent as the original Software or media
for the remainder of the original warranty period or 30 days from the date of receipt by the
customer, whichever is longer.
Limitation Of Liability
IN NO EVENT SHALL CRYPKEY BE LIABLE TO THE CUSTOMER FOR INDIRECT,
INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGE. IN NO EVENT SHALL
CRYPKEY CANADAS AGGREGATE LIABILITY TO THE CUSTOMER EXCEED THE
AMOUNTS PAID TO CRYPKEY BY THE CUSTOMER FOR THE SOFTWARE.
The software described in this manual is furnished under a License Agreement and may
only be used in accordance with the terms of this agreement.
Microsoft, Windows, Visual Basic, Access, Windows NT, Windows 95, and Windows 98
are trademarks of Microsoft Corporation. Watcom is a trademark of Watcom International
Corporation. PowerBuilder is a registered trademark of Powersoft Corporation. Novell is a
registered trademark of Novell, Inc
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Table of Contents
Section Page
1 Introduction 1
1.1 About CrypKey (Canada) Inc. 2
1.2 About CrypKey SDK 2
1.3 How to Use This Book 3
1.3.1 Summary of Contents 4
1.3.2 Strategies for Using This Manual 5
1.3.3 Special Icons 7
1.4 System Requirements 7
1.5 Technical Support 8
1.6 About Your CrypKey License 9
1.6.1 Registering with CrypKey (Canada) Inc. to Get Your Developer Keys 10
1.6.2 Using the Temporary License for Development 11
1.6.3 Obtaining Authorization for Your Site Key Generator 11
1.7 CrypKey Licensing Implementation 15
1.8 New Features in Version 6.0 17
1.8.1 CloneBuster TM Technology 18
1.8.2 EasyLicense 19
1.8.3 Dynamic Encryption 19
1.8.4 Enhanced Anti-Hacking 19
1.9 Updating to CrypKey SDK v6.0 20
2 Installation 23
2.1 Getting Started 23
2.1.1 Installing CrypKey SDK from CD 24
2.1.2 Downloading and Installing CrypKey SDK 34
2.1.3 Packing List and Readme Files 40
I C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3 Demonstration Programs 51
3.1 Authorizing a Windows Program 51
3.2 Authorizing an MS-DOS Program 57
I I C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
I I I C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K I V
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
11 Troubleshooting 149
11.1 CrypKey Error Messages 149
11.1.1 General Errors 149
11.1.2 Function Errors 150
11.2 General Error 102 150
11.2.1 CrypKey License Service Problems 151
11.2.2 CrypKey Technical Support 154
11.3 Windows NT Diagnostics 155
11.4 NetWare-related Issues 155
11.4.1 Sample Error 1 156
11.4.2 Sample Error 2 156
11.4.3 Sample Error 3 156
11.5 Norton Utilities Speed Disk 157
V C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
15 Glossary 259
16 Index 263
C RY P K E Y S D K V I
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
TABLE Page
Table 1: Files required for distribution with 32-bit Applications 47
Table 3: Libraries 93
Table 7: COM C++ and C#.NET Prototypes for FLS Record Data Items 104
V I I C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K V I I I
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
FIGURE Page
Figure 1: Site Key Generator Startup 12
I X C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Figure 26: Site Key Generator Window with Validated Site Code 55
Figure 36: Site Key Generator with New Application Popup Window 71
Figure 43: Distributor's Unauthorized SKG License Window with Site Code 81
Figure 44: Master Site Key Generator with Distributors Site Code 82
Figure 45: Master Site Key Generator with Slave Site Key and Selected Options 83
C RY P K E Y S D K X
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
X I C RY P K E Y S D K
U S E R M A N U A L
Introduction
WelcometoCrypKeySDKandtheCrypKeyworldof Section
1
softwareprotection.
rypKeyisarevolutionarySoftwareLicensingApplicationProgram
C Interface(SLAPI)thatprovidestheserioussoftwaredevelopment
companywithinvisiblesecurityandcompleteflexibilityoverthelicensing
ofitsproducts.TheCrypKeysystemisdesignedtoreplaceanyexternal
hardware(dongle)orfloppydiskbasedkeysystemincopyprotection
effectiveness.
WiththeCrypKeySoftwareDevelopersKit(SDK),you(thesoftwaredeveloper)
can:
protectasoftwareproductfromunauthorizeduseonaturnkeybasis
grantcustomersdifferentlevelsofprivileges
grantcustomersusageprivilegeslimitedbytimeornumberofuses
Youcanprovidealloftheseservicesviatelephone,fax,oremail.
CrypKeySDK:
usesnohardwarekeyordiskkey
includesasoftwarelibrarythateasilyintegrateswiththedevelopers
existingprograms
canbeusedtotrackandcontrolprotectedsoftwaresoldbythirdparty
distributors
defeatsharddiskdrive(HD)cloningofyoursoftware
1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
TheCrypKeyproductandservicebusinesswasspunoffbycurrent
managementintoCrypKey(Canada)Inc.inMarch2002.TheCrypKeyteamhas
developednew,ultrasecure,industryfirstCloneBusterTMtechnologyforits
version6.0.
CrypKeyhasdeliveredbattleprovensoftwarecopyandlicenseprotectionfor
thousandsofcompaniesworldwidesince1992,including:Nokia,Ericson,IBM,
MicrosoftCaterpillar,Eaton,Dupont,Fujitsu,Minolta,HP,Honeywell,3M,
LockheedMartin,Mobil,Procter&Gamble,Siemens,Verizon,Sybase,
Bell&Howell,Kodak,AllenBradley,andABB.
ThisusermanualcontainsexampleUserandMasterKeys(seebelow)foruse
duringyourtrialperiod.Thesetemporarykeysarenotintendedfordistribution
withyourproduct.IfyoudistributeyourproductwiththesetemporaryUser
andMasterKeys,recipientswhohaveCrypKeycanunlockyourproduct.Since
allSiteKeyGeneratorscancreatekeysforanyprogramthatusesthetemporary
keys,theonlykeysyoushoulddistributewithyourproductarethose
specificallycreatedfortheproduct.
Example Keys
UserKey:D050815CD1A2A79DB103
MasterKey(16bit):2A5D57C41B4C135BF09E17F7600B2D7079E8
F275C36A
MasterKey(32bit):
C RY P K E Y S D K 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
F2C938D2D34678D2E9217C18D78EA6A8E466CF49520F92CDD1B6916
\BD460D60E7C7B4CC7CC1750BD7188F90AC132B915E82FC8FA60A1
D299DA0F28EA3C66BD42DB\0BE62149DAAEE4DBA55C0E70CE1C13
BD343F8B7573ABC1E7DA0695955AB2BD377F50A9BE29A\04CF816B3
0CD171E1509AD65100C999E52A35F45A215212A970
CrypKeySDKofferstwotypesofdeveloperkeysthoserelatedtotheexample
fileandthoselockingCrypKeytoyourproduct.Thinkofkeysasalphanumeric
stringsoftext.YourequirethefollowingfourkeystorunCrypKeySDK:
UserKey:createdfromtheCrypKeypasswordyouspecify
MasterKey:createdfromthefilenameyougivetoCrypKeyandother
pertinentinformation
SiteCode(generatedfromyourcomputeronwhichCrypKeySDKis
installed):requiredinordertoobtainyoursitekey
SiteKey(fortheSiteKeyGenerator):enablesyoutoauthorizeyour
productusingyourSiteKeyGenerator
PleasenotethatCrypKeySDKisdesignedforsoftwaredistributors.Allmaterial
inthismanualassumescompetenceonyourpartintheuseofWindowsbased
programs.
Followingisasummaryofthemanualscontents,aswellasstrategiesforusing
it.
3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Chapter2,Installation,focusesontheinstallationandsetupoftheCrypKey
softwareandassociateddrivers(WindowsNT/9x/ME/2000/XP,MSDOS),files,
andsoftware.
Chapter3,DemoPrograms,providestwoexamplesofCrypKeyoperationone
fortheWindowsenvironmentandtheotherfortheMSDOSenvironment.
Chapter4,SiteKeyGenerator,discussesthecoreoftheCrypKeyinterface,
namelytheSiteKeyGenerator,whichisusedforconfiguringtheprotection
featuresforyoursoftwareandissuinglicensestoyourcustomersand
distributors.
Chapter5,ProgrammingYourApplication,discussesthebasicstepsin
programmingCrypKeyprotectionfeaturesandlicenseinformationintoyour
application.ItdiscussestheCrypKeylibrariesandhowtolinktothem.Italso
includesinstructionsforusingtheCrypKeyCOMObjects,whicharetoolsthat
facilitateandsimplifytheuseoflibraries.
Chapter6,ProtectingYourSoftwarewithStealthPLUSTM,discussestheuseof
CrypKeysStealthPLUSTMproducttoprotectyourdistributedapplication
againsthackers.Supplementaryinformationonthisissueisprovidedin
Chapter7,CounterHackerStrategies.
Chapters8,NetworkLicensing,and9,MovingProtectedPrograms,dealwith
networklicensingandlicensetransfersbycustomers.
Chapter10,FrequentlyAskedQuestions,discussesgeneralandtechnical
questionsthatuserscommonlyraiseaboutCrypKeySDK.
C RY P K E Y S D K 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Chapter11,Troubleshooting,providesstrategiesforidentifyingproblemsand
dealingwiththemostcommonCrypKeyerrors,themostfrequenterrorbeing
Error102(producedbytheInitCrypKey()function).Thischapteralsodealswith
CrypKeyLicenseServiceerrors,WindowsNTdiagnostics,NetWareissues.As
well,itidentifiesthegeneralinformationthatyouneedtoprovidetoCrypKey
technicalsupportstaffifyouhaveaproblemrequiringtheirassistance.
Chapter12,FunctionReference,providesdetailedinformation,includingusage,
syntax,parameters,anderrors,concerningallprogrammingfunctionsusedin
CrypKey.Thischapterincludesasummaryoffunctiondescriptions.Foraquick
referenceoffunctionsyntax,seeAppendixII.
Chapter13,AppendixI,containsthecodeforasampleCrypKeyexecutable,
demonstratingtheuseofCrypKeylibraryfunctions.
Chapter14,AppendixII,containsquickreferenceinformationaboutfunctions
anderrors.
AttheendofthemanualareaGlossaryandIndex.
TheSiteKeyGenerator,ProgrammingYourApplication,andFunctionReference
chaptersareyourmainresourcesfordaytodayuseofCrypKeySDK.In
addition,AppendixIIisusefulforquickreferenceinformationaboutfunctions
anderrors.Specifically,Sec.14.2:CrypKeyReturnCodesdiscusseserrors
returnedbythetwoCrypKeyfunctionsthatmustbecalledforalloperations
InitCrypkey()(seeSec.12.3.26)andGetAuthorization()(seeSec.12.3.13).
IfyouareexperiencingaproblemwithCrypKey,wesuggestinitiallyreviewing
theFrequentlyAskedQuestionsandTroubleshootingchapters,aswellas
AppendixIIQuickReference.Iftheproblemidentificationandpossible
solutiondonotcometolightfromthesesections,lookformoredetailinthe
FunctionReferenceandProgrammingYourApplicationchapters.Ifitisnot
5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
readilyapparenthowtoresolvethesituation,thenpleasecontactCrypKey
technicalsupportseeSec.1.5:TechnicalSupport.
C RY P K E Y S D K 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
DONT FORGET
GLAD COMPUTER
WATCH OUT
CrypKeySDKrequiresthefollowingminimumPChardwarerequirements:
a486(orbetter)processorwith64MBofRAMand25MBoffreespace
onyourharddrive
aVGAcolormonitor
7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
amouse
Windows3.1,Windows95,Windows98,orWindowsNTplatforms(NT,
2000,XP)
CrypKeySDKsupportsthefollowingdevelopmentplatforms:
MicrosoftC++6.0,7.0,and8.0(directly,usingstaticlibraries)
MicrosoftVisualC++1.5,2.x,4.x,5.xand6.x,andC++.Net(directly,
usingstaticlibraries)
BorlandC++4.x(directly,usingstaticlibraries)
BorlandC/C++3.xormorerecent
anydevelopmentsystemcapableofreadingandwritingafilevia
externallinking(forMSDOS)orDLL(for16or32bitWindows).This
includes,butisnotlimitedto,MicrosoftVisualBasic,MicrosoftFoxPro,
MicrosoftAccess,CAClipper,BorlandDelphi,BorlandVisualdBASE,
BorlandParadox,andPowersoftPowerBuilder.
.NetVB.Net,C#.Net,C++.Net
readthemanual(mostproblemscanbesolvedusingtheinformation
containedinthisdocument)
workthroughthedemonstrationsinChapter3,whichprovideabasic
understandingofCrypKeySDK
testthesampleprogramwithinthescenariosyouareinvestigating
(again,mostquestionscanbeansweredusingthismethod;ifproblems
persist,trythesamesituationwithexample.exe)
C RY P K E Y S D K 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Ifthesealternativesdonotsatisfyyourrequirements,pleasecontactusby
phoneoremail.Ourbusinesscontactinformationislistedbelow.
CrypKey(Canada)Inc.
WorldHeadquarters:
MailingAddress CrypKey(Canada)Inc.
TheDevenishHeritageBuilding
90817thAvenueSW
Suite208
Calgary,Alberta
T2T0A3Canada
WorldHQPhone: 14033988011
RegularBusinessLine: 14032586274
FaxLine: 14032648838
Supportemail support@crypkey.com
Internet http://crypkey.com
PacificRimOffice:
Email Greg.Wible@crypkey.com
Phone: 15629898976
eFax: 12089788503
9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Site Key:ThiskeyisrequiredtounlockanyCrypKeyprotected
software.SincetheSiteKeyGeneratorisprotected,youmustsendus
thesitecodesothatwecanauthorizeyourSiteKeyGenerator.
Company Number:Thisvalueisspecifictoyourcompanyandisused
fortheCKChallenge()function.
Password Number:Thisvalueisspecifictoyourpasswordandisused
fortheCKChallenge()function.
Althoughyoucandevelopyourapplicationwithoutthedeveloperkeysusing
thetemporarylicenseprovided,youeventuallyneedthekeysforfinaltesting
andshippingofyourproduct.Thesekeysareissuedonlyafterwereceiveyour
payment.Ifyouareworkingunderanaggressivedevelopmentschedule(who
isntthesedays?),weaskthatyoutimeyourpaymentaccordingly.
Procedure
1. FinishtestingCrypKeySDKandyourproductusingtheexample
developerkeys.
2. ConfirmyouhavepaidforCrypKeySDK.IfyouselectedBillNet30or
TelegraphicTransfer,pleaseensureyourpaymenthasbeensent.We
canauthorizeyoutouseCrypKeySDKonyourproductonlyafterthe
paymenthascleared.
3. Sendusthefollowinginformationviaemail,fax,ortelephone:
a. yourCustomerServiceNumber(CSN),locatedontheinside
coverofthisusermanual
b. thefilenameofyourproduct(maximum8.3characters)
c. thepasswordforyourproduct(maximum12characters)
d. yoursitecodefromyourSiteKeyGenerator(seeSection1.6.3:
ObtainingAuthorizationforYourSiteKeyGenerator)
C RY P K E Y S D K 1 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Master Key:2A5D57C41B4C135BF09E17F7600B2D7079E8F275
C36A
Youdonotrequireatemporarysitekey.
Tousethesekeys,youmust(temporarily)eitherplaceafilecalledexample.exe
inthesamedirectoryasyourapplicationorrenameyourexecutableto
example.exe.Also,youmustuseCRYPKEYasyourpasswordwheneveryou
useyourSiteKeyGeneratorintestauthorizations.
Underthistemporaryarrangement,youarecheckingandmodifyingthelicense
forexample.exe.Thismeansyoucanuseexample.exetotestyourprograms
licenseoperations.
Donotshipyourapplicationusingthekeysthatareprovidedtoyouwiththe
trialsoftware.Theexamplekeysarestrictlyforuseduringyourtrialperiod,as
anyonewiththeCrypKeyproductcancreatekeysforanyproductprotectedwith
theexamplekeys.
1 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
WhenyouhavefinishedtestingyourproductwithCrypKeyandarereadyto
acquireSiteKeyGeneratorauthorizationfromus,usethefollowingstepsto
determinethesitecodefromyourSiteKeyGenerator:
1. StartyourSiteKeyGeneratorbydoubleclickingitsiconintheCrypKey
SDKprogramgroup.
C RY P K E Y S D K 1 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2. ClickLicense intheSiteKeyGeneratordialogbox.Yoursitecode
appearsintheLicensedialogbox,asshownbelow.
3. Sendusyoursitecodeviaemail,fax,orphone,alongwiththeother
informationoutlinedinSection1.6.1:RegisteringwithCrypKey
(Canada)Inc.toGetYourDeveloperKeys.
1 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
4. Onceyoureceiveyoursitekey,typeit(orcutandpasteitfromouremail
message)intotheSiteKeyfieldintheLicensedialogbox.
5. ClickValidate. ToensurethatyourSiteKeyGeneratorisauthorized,
returntotheLicensedialogbox:
C RY P K E Y S D K 1 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Youmayalsochoosetoorganizethefeaturesofyourapplicationin
termsofspecificlevelsandoptions,whichareautomatically
facilitatedwithintheCrypKeysystem.Infact,werecommendyoudo
1 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
thisifitisappropriatefortheapplication,sincethisallowsyoutouse
thefullfeaturesetthatCrypKeyprovidesforlicensing.
CrypKeyCanadaInc.alsoprovidesaproductcalledCrypKeyInstant,
thatembedstheCrypKeylicensingprotectionsystemwithinyour
applicationexecutablewithoutrequiringanychangestothesource
code.Thisproductoffersanalternativemethodofcopyrightprotection
todevelopersanddistributors.
2. You experiment with CrypKey and test the application using the
temporary license provided. Ifyouarecompletelysatisfiedwith
CrypKey,faxustherequiredinformation.Wefaxyoukeysthatactivate
yourSiteKeyGeneratorlicenseforthespecificproduct(s)in
development.Theproductexecutablename,password,SiteKey
Generatorsitecode,andcustomerserviceidentificationnumberare
requiredinordertocreatethedeveloperkeysthatenableyoutolicense
theproduct(s)tocustomersusingtheSiteKeyGenerator.Thereisa30
daymoneybackguarantee,soyoumayfullytesttheCrypKeysystem,
withoutrisk,usingthetemporarylicenseprovided.AllCrypKeySDK
featuresareavailabletoyouduringthetrialperiod.
PleasenotethatCrypKeycannotbereturnedoncethedeveloperkeysfor
yourproduct(s)havebeenissued.
C RY P K E Y S D K 1 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
uniquetothepersonalcomputerthattheapplicationisinstalledon.
Thesitecodeappearsasanencryptedalphanumericnumber.CrypKey
allowslicenserestrictionstobespecifiedintermsofalimited(or
unlimited)numberofdaysorruns.Runsareimplementedinthe
applicationinwhatevermanneryoudesignate.Thenumberofprogram
copiesorconcurrentnetworkusersisalsospecifiedwithinthelicense.
5. You enter the customers site code into the Site Key Generator
and set the license configuration. Asitekey,whichprovides
specifiedaccesstotheapplication,isthengeneratedandgiventothe
customerwhenyoureceivepayment.Thespecificlevels,options,and
permissionsaregenerallyreferredtoasthelicenseintheCrypKey
system.Thisinformationisembeddedandencryptedwithinthesitekey
anditactivatesandconfiguresthecustomerslicensewhenitisentered
intotheapplicationbythecustomeranddecrypted.Anysitekeyyou
generateworksonlywiththeinstalledapplicationthatcreatedthesite
codeprovidedbythecustomer.TheSiteKeyGeneratorautomatically
verifiesthatthesitecodegivenisauthentic.
6. Your customer uses the site key provided by you to unlock the
application under the terms specified. Sitecodesandsitekeyscan
betransferredbyemail,telephone,orothermeansbecausetheyare
alphanumericstringsofmanageablelength.Theprocessofissuinga
sitekeyforacustomersspecificsitecodeisreferredtoas
authorizationintheCrypKeysystem.CrypKeyautomaticallytracks
restrictionsintermsofdaysorrunsandinvalidatesthelicensewhenthe
timeperiodexpiresorthenumberofrunsisused.TheCrypKey
functionsinsidetheapplicationverifythatthesitecode/sitekey
combinationisvalidbeforeaccessisprovidedtothecustomer.Also,the
licenseisuniquelyspecifictothepersonalcomputeronwhichthe
applicationruns.Ifthecustomercopiestheprogramanditslicensefiles
toanothercomputer,thelicensebecomesinvalidonthatmachineand
doesnotallowaccess.ThisoccursbecauseCrypKeyiscapableof
identifyingtheexactcomputerthelicensewasissuedforwithoutthe
useofanexternalhardware(dongle)orfloppydiskkey.
1 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
CrypKey6.0hasbenefitedfromtheexperienceofournowsizablecustomer
base.Wehaveconcentratedontrackingdownandfixingeveryknownproblem
onthemanyplatformsCrypKeysupports.Theresultisrobustsoftware.Before
thisrelease,99%ofallsupportproblemswerefixedjustbysendingthis
software.
Wealsohavearelatedproduct,CrypKeyInstant,that:
protectsDOS,DOS32bit,Win16,andWin32programswithnosource
codechanges
doesnetworkfloatinglicensingwithnosourcecodechanges
supportsinternationallanguagesandenablesyoutoswitchoradd
languagesatruntime
encryptsdata
MoreinformationaboutCrypKeyInstantisavailableonourwebsite,at
http://crypkey.com.
ThechangeswevemadeinCrypKey6.0include:
CloneBusterTMtechnologyforharddriveserialnumber(HDSN)
recognition
EasyLicense
dynamic,multikeyencryption
enhancedantihackingcapability(StealthPLUSTM)
Thesenewfeaturesaredescribedinmoredetailbelow.
C RY P K E Y S D K 1 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Manypopularcopyprotectiontechnologiesthatdependonplacingsometype
ofsimplesoftwarefootprintarenoweasilydefeatedbythesenewHDcloning
techniquesandarenolongeraneffectiveoption.Manyunproven,startup,
venturecapitalbacked,rightsmanagementplatformprovidersarenot
practicallyviable.Theyoffergrand,andoftenexpensive,protectionschemes
thatfailtorecognizeallthenumerousfirewall,integration,distributed
deployment,andsupportissuesgeneratedbytheirsocalledconnected
productvision.HardwaredonglesprovidelimitedprotectionagainstHD
cloning,butareexpensiveanddislikedbyendusers.CrypKey6.0,which
includesCloneBusterTMtechnology,effectivelysolvesthisproblem.
MostmodernIDEharddriveshaveburnedinserialnumbers(HDSN).Notto
beconfusedwiththeeasilychangedvolumeserialnumber,theHDSNisa
permanent,readonlyattributeofapersonalcomputerharddrive.TheHDSN
isverydifficulttoaccess,butCrypKeySDK6.0withCloneBusterTMtechnology
hasthisability(patentpending).LeveragingCrypKeystenyear,proven
protectionarchitecture,CloneBusterTMdetectsandlogstheHDSN,model
number,andfirmwareidentifierandusesthisinformationinitsproprietary
licensingalgorithms.AlthoughHDcloningprogramssucceedinbreakingother
simplecopyprotectionschemesinordertocopyanentireharddrive,they
cannotachievethisagainstCrypKeyarmedwithCloneBusterTM.
1.8.2 EasyLicense
Somecustomersneedthesimplestpossibleformofcopyprotectionwhena
particularapplicationrunsonlyonaparticularcomputer.Thesecustomersdo
notwanttodealwithanyassociatedissuesoftransfer,networklicense,trial
period,ornumberofcopies.Whetherthesoftwareisoffloadedandputback,
deletedandrestoredlater,ortheentireharddriveiserasedandrestored,the
applicationstillsrunonthecomputer.
EasyLicenseoffersthistypeofprotectioncoupledwithsimplicity.
1 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1. ObtainanewMasterKeyforeach32bitapplicationyouwishtoprotect.
2. ObtainanewSiteKeyforyourversion6.0SiteKeyGenerator.
3. Ifyouhavea32bitapplication,addanewfile,CRP32001.NGN,tothe
directoryyourapplicationresidesin.Thisfileisfoundinthe\Libs\32bit
directorythatiscreatedwhenyouinstallCrypKey6.0.
Theversion6.0librariesworkonlywiththenew32bitSiteKeyGenerator
6.0andlater.YouroldSiteKeyGeneratorcannotauthorizethese.
4. PleasenotethenewThunklibrarynamesCRYP95F.DLLand
CRYP9516F.DLL.ThesenewlibrariesmustbepresentwhenWin9XandME
arerun.
ThenameCRP9516F.DLLreplacesallpastversionsofCRP9516?.DLL.The
nameCRYP95F.DLLreplacesallpastversionsofCRYP95?.DLL.However,
C RY P K E Y S D K 2 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
thenameoftheotherfileinthesamedirectory,CK16RMV.EXE,hasnot
changed.
5. ThelocationoftheThunkDLLshaschanged.Theymustbefoundinoneof
thefollowing:
thedirectory(searchedfirst)whereyourapplicationresides
thedirectory(searchedsecond)whereyourCrypKeylicenseresides
Iftheydonotresideinoneofthesedirectories,a
THUNK_LIB_NOT_FOUNDerrorresults.Windowsandsystemdirectories
willnotwork.
Note:ForVBandDelphiuserswhenyourunyourapplication
undertheIDE(notcompiledstandalone),theapplication
directoryistheIDEdirectory,notthedirectorywhereyour
applicationis.Wepreviouslytoldyoutocorrectthisproblemby
puttingtheThunklibrariesintheWinDirectory,butthiswillnot
worknow.LocatetheThunklibrariesinthedirectorywhereyou
tellCrypKeytoputitslicense.
Whendevelopingwiththe.NETorC++IDEsyoucannotdebug
callstoCrypKey.Ifyouneedtodebugyourprograms,bypass
yourCrypKeycallstemporarily.
6. Thisupdateincludesall6.0librariesandDLLs.Youneedonlythosethat
applytoyourapplication.
7. Dooneofthefollowing:
reconfigureSKW
copyyourskw.inifromapreviouslyconfiguredSKWandaddthe
followinglineattheendofyourfile:
EasyLicense=0
8. Anuninstallfeature,andotherimportantchanges,havebeenaddedtothe
NTDriver(seeSec.5.6.4).
2 1 C RY P K E Y S D K
U S E R M A N U A L
Installation
ThischapterprovidesdetailsonhowtoinstallCrypKey Section
2
SDKanditsassociatednetworkdriversonyoursystem.
A networkdriverdoesnothavetobeinstalledtouseaCrypKeyprotected
applicationinstandalonemodeortouseCrypKeySDKonyourmachine
(exceptinthecaseofWindowsNTplatformsseeSec.8:Network
Licensing:andSec.5.6:CreatingaWindowsNTLicenseServiceInstallation).
DriversareprovidedsoyoucanrunaCrypKeyprotectedapplicationfroma
serveronclientworkstationsoveranetwork.
WhetherrunfromaCDorfromdownloadedfiles,theinstallationprogram
createsthefollowingCrypKeygroupinyourStartmenu(Windows
95/98/ME/NT/XP/2000)orinProgramManager(Windows3.1):
2 3 C RY P K E Y S D K
U S E R M A N U A L
2.1.1 Installing CrypKey SDK from CD
Procedure
1. EnsureWindowsisrunningonyourcomputer.
2. InserttheCrypKeyCDROMintoyourCDROMdrive.CrypKey
automaticallystartsup,displayingthefollowingwindow:
2 4 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3. ClicktheInstallbutton.Thesystemdisplaysthefollowingwindow:
2 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 2 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
4. Intheabovewindow,typethepasswordprovidedbyCrypKey.Whenyou
havecorrectlyenteredtheentirepassword,theNextbuttonisenabled,as
shownabove.ClickNexttodisplaythefollowingwindow:
2 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 2 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 3 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
5. Intheabovewindow,specifywhereyouwantCrypKeySDKinstalledby
acceptingthedefaultdirectoryprovidedbytheinstallationprogramorby
typinginapathforittouse.Ifthedirectorydoesnotalreadyexist,the
installationprogramcreatesitforyou.
3 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
WestronglyrecommendthatyoureadtheReadmefileimmediately,asit
maycontaindetailsthatwerenotavailableintimetobeincludedinthis
manual.
C RY P K E Y S D K 3 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. Whenyouhavecompletedthedownloadoftheinstallationfilestoyour
computer,doubleclickthefileCrypKeySDK60.
Thesystemdisplaysthefollowingwindow.Thisisthefirstofasequence
ofstandardinstallationwindows.Ineachone,simplyclickNextafter
youhaverespondedtotheprompts,ifany,inthatwindow.
3 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 3 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 3 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2. Intheabovewindow,specifywhereyouwantCrypKeySDKinstalledby
acceptingthedefaultdirectoryprovidedbytheinstallationprogramor
bytypinginapathforittouse.Ifthedirectorydoesnotalreadyexist,
theinstallationprogramcreatesitforyou.
3. Oncethedriveanddirectoryarecorrect,clickOKtocontinuethe
installationprocess.
C RY P K E Y S D K 3 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
4. Intheabovewindow,youareaskedifyouwanttoviewtheReadme
file.Youmayreadthefilenoworchoosetoviewitlater.
WestronglyrecommendthatyoureadtheReadme immediately,asit
maycontainlastminutedetailsthatwerenotavailableintimetobe
includedinthismanual.
3 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
ThereadmefileislocatedinyourCrypKeydirectory.Itcontainsimportantlast
minuteinformationthatwasnotavailableintimetobeincludedinthemanual.
YoushouldreaditafterinstallingCrypKeyonyoursystem.
Followingistheinformationinthereadmefile,atthetimeofpublication,
aboutthecontentsofeachinstalleddirectory.
1. Demos
Thisdirectorycontainsthecompiledexecutableversionsofthesample
codefoundintheSamplesdirectory.IfyouareusingNT,thisdirectorywill
besetuptohavetheCrypKeyNTDriverservingit.
2. External
ThisdirectorycontainssamplecodeforusingExternalLinkingwith
CrypKey.Youwouldusethisifyoucouldnotlinktooneofourlibrariesof
DLLsfromyourparticulardevelopmentenvironment.(Example:Turbo
Pascal).
3. Include
ThisdirectorycontainstheincludefilesyouwoulduseifusingCorC++.
Currently,thereisonlycrypkey.h.
4. Lib
ThiscontainsanumberofdifferentversionsoftheCrypKeylibrary.Tohelp
youfindthefilesyouneed,thisdirectoryisfurthersubdividedinto16and
32bit.Underboth16and32bit,therearelibrariesforMicrosoftand
Borlandcompilers,aswellasgeneric16bitDLLs.
5. Netdrive
ThisdirectorycontainsthedriverneededforallCrypKeyNTPlatform
usage,aswellasdriversforusingCrypKeywithnetworks.
Fiveservertypesaresupported:
NTPlatform(IncludesXP,Win200,NT)
Windows3.xor9.x
C RY P K E Y S D K 4 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Novell3.xandhigher
MSDOS
OS2
6. Samples
Thisdirectorycontainsvarioussamplecodefromdifferentplatforms.Some
samplesarecontributedbykindheartedCrypKeycustomers(andwealways
welcomemore).Thesesamplesareagoodstartingpointandcanalwaysbe
improvedupon.
7. SiteKeyGenerator
ThisdirectoryhousestheCrypKeySiteKeyGenerator.Forthoseupdating
frompreviousversions,wethinkyouwillliketheimprovements.
8. Stealth
ThisdirectorycontainstwoversionsofCrypKeyStealthPLUSTM:
STELTHUI.EXEuserinterfaceversion
STELTHCM.EXEcommandlineversion
9. CrypKeySDKCOMObject
ThisdirectorycontainstheCrypKeyCOMobject.Thisistheeasiestlibrary
tointegrateintoVBandVisualC.Thisdirectoryalsoincludesthe
documentationandVBandVCsampleprograms.
10. CrypKeySDKdotNET
ThisdirectorycontainstheCrypKey.NETassembly.Thisistheeasiest
librarytointegrateintothe.NETlanguages(VB.NET,C#.NET,andC+
+.NET).ThisdirectoryalsoincludesthedocumentationandC#.NETand
VB.NETsampleprograms.
11. Thisdirectorycontainsthismanual.Youmaywishtousesomepartsin
yoursoftwaredocumentation.
4 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
TheCrypKeyLicenseServicemanageslicenses.InNTenvironments,itis
requiredforeitherstandaloneornetworkinstallations.
TorunaCrypKeyprotectedMSDOS,Win16,orWin32programfromalocal
driveonaWindowsNTplatform,youmustinstalltheCrypKeyLicenseService
onthatmachine.TheCrypKeyLicenseServiceisrequiredbecauseWindows
NTdoesnotallowprogramstodirectlyaccessthecomputerhardware,which
CrypKeymustdo.Fortheinstallationprocedures,seeSec.5.6:Creatinga
WindowsNTLicenseServiceInstallation.
IfyouarecurrentlyrunningCrypKeyonaWindowsNTpersonalcomputer,you
alreadyhavetheCrypKeyLicenseServiceinstalled.Ifyouwanttousethe
LicenseServicewiththeinstallationofyourapplication,youcanfinditin
C:\CrypKey.60\Stealth.
StealthPLUSTMcaninstalltheLicenseServiceautomaticallyforyou.Formore
details,seeChapter6:ProtectingYourSoftwarewithStealthPLUSTM.
WenolongersupportcustominstallationsforWindowsNTdrivers.
Beforerunningwckserve.exe,anenvironmentvariablemustbesettotellit
wheretheCrypKeyprotectedprogramis.Thebestwaytodothisistoputa
commandintheautoexec.batfileasfollows:
Here,dir,dir2,dir3,etc.,arepathstothedirectoriesthatholdCrypKey
protectedprograms.IfthereismorethanoneCrypKeyprotectedprogramon
C RY P K E Y S D K 4 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
thecomputer,apathmustbegivenforeachdirectory,endingwitha
semicolon.Whenthecomputerisrebooted,theSETcommandtakeseffectwith
theparametersspecified.
Alternatively,wckserve.exeacceptsthedirectorystringnormallyinthe
WCKSERVEenvironmentasacommandlinevariable:
WCKSERVE.EXE C:\MYAPP1;C:\MYAPP2
Here,MYAPP1andMYAPP2aredirectoriescontainingCrypKeyprotected
applications.
Toconfigurewckserve.exetoautomaticallystartandruninthebackground,
addwckservetotheStartupgroup.WhenWindowsisrestarted,thedriverruns.
Note:theservermustgivereadandwritepermissiontoitsclientsforthe
directorywheretheCrypKeyprotectedsoftwareresides.Ifwritepermissionis
notgiven,allnetworkaccessrequestsaredenied.
Beforerunningckserve.exe,anenvironmentvariablemustbesettotellitwhere
theCrypKeyprotectedprogramis.Thebestwaytodothisistodefinean
environmentvariableintheautoexec.batfileasfollows:
Here,MYAPP1,MYAPP2,etc.,aredirectoriescontainingCrypKeyprotected
applications.IfthereismorethanoneCrypKeyprotectedprogramonthe
computer,apathmustbegivenforeachdirectory,endingwithasemicolon.
Whenthecomputerisrebooted,theSETcommandtakeseffect.
Alternatively,ckserve.exeacceptsthedirectorystringnormallyintheCKSERVE
environmentasacommandlinevariable:
4 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Here,MYAPP1, MYAPP1,etc.,aredirectoriescontainingCrypKeyprotected
applications.
Tostartckserve.exe,ensuretheprogramisloadedonthecomputer.Typethe
programnamefromtheMSDOScommandlinewithnooptions.This
commandshouldbeputintotheautoexec.batfile.Youcanputckserve.exein
anydirectory,aslongasyounamethefullpathwhenyoustartit.
ThisprogrammustberunfromMSDOS(version3.1orhigher).Itcannotbe
runwithWindowsonthesamecomputer.Contactusifyouneedthisability.
Theservermustgivereadandwritepermissiontoitsclientsforanydirectories
whereCrypKeyprotectedsoftwareresides.Ifwritepermissionisnotgiven,all
networkaccessrequestsaredenied.
2.4.1 Example
ConsideranexamplewherethereareCrypKeyprotectedprogramsinthe
followingdirectories:
C:\APPS\BINGO
E:\WINDOWS\WHIZBANG
D:\TEMP
Ifyouwantyouruserstobeabletooperatethefirsttwoprogramsfromother
computersthatarelinkedbyanetworkandyouhaveckserve.exeloadedinto
thedirectoryC:\util,putthefollowingcommandsintheautoexec.batfile:
SET CKSERVE=C:\APPS\BINGO;E:\WINDOWS\WHIZBANG;D:\TEMP
C:\UTIL\CKSERVE.EXE
Rebootthecomputertoputthesecommandsintoeffect.
C RY P K E Y S D K 4 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Ckserver.nlmisusedforallNetWareservers.Itmustbegivenread,write,
filescan,modify,anddeletepermissionsfortheservermachinethatitis
servicing.Ckserver.nlmcanserviceonlythelocalfileserverthatitisinstalled
on;thisincludestheSYSvolumeandallothervolumesontheserver.
Ckserver.nlmisselfconfiguringanddetectsanyCrypKeyprotectedprogram
ontheserveritrunson.Itdoesnotrequireanyinteractionorconfiguration
fromtheadministratoronceithasbeenloaded.
Formoredetailsonlinkingyourapplicationtolibraries,seeSec.5.3.2:Linking.
Formoredetailsonlibrariestobedistributedforvariousplatforms,seeSec.
14.3:CrypKey6.XOSFileDistributionMatrix.
SeeSec.2.6.3foradiscussionoftheThunklibrarieswithinthe32bitlibraries.
LCRYPKY7.LIBMicrosoftC7.0andDOS
LCRYPKYM.LIBMicrosoftC7.0andWindows3.1
4 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
LCRYPKYD.DLLWindowsDynamicLinkLibrary(DLL)
LCRYPKYD.LIBMicrosoftC7.0ImportLibraryforDLL
Table1:Filesrequiredfordistributionwith32bitApplications
CRYP95f.DLL Thesethreefilesmustbe
distributedwithyourprogram.
CRP9516f.DLL Theymustbeputinthesame
directoryasyour32bit
CRP32001.NGN application,orinthedirectory
thatholdsyourlicense.
CRP32M60.LIBMicrosoftVC++6.0Win32library(multiplethreadStaticRT
Libraries)
CRP32D60.LIBMicrosoftVC++6.0Win32library(multiplethreadDynamic
RTLibraries)
CRP32S60.LIBMicrosoftVC++6.0Win32library(singlethreadRTLibraries)
CRP32M42.LIBMicrosoftVC++4.2Win32library(multiplethreadStaticRT
Libraries)
CRP32D42.LIBMicrosoftVC++4.2Win32library(multiplethreadDynamic
RTLibraries)
CRP32S42.LIBMicrosoftVC++4.2Win32library(singlethreadRTLibraries)
C RY P K E Y S D K 4 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
CRP32DLL.DLLWin32DLL(multiplethreadRTLibraries)
CRP32DLL.LIBMicrosoftVC++4.2importlibforCRP32DLL.DLL
CRP32BMT.LIBBorlandC++4.51Win32library(multiplethread)
CRP32BST.LIBBorlandC++4.51Win32library(singlethread)
Thefollowingfilesarefoundinotherdirectories:
CRYPKEYCOM.DLLCOMobjectforallcompilersthatcanuseCOM
objects.
CRYPKEYNET.DLL.NETassemblyforallcompilersthatcanuse.NET
assemblies.
CRYP9516f.dll,CRP95f.dll,andCK16RMV.exearethethreefilesthatmustbe
includedfor32bitapplicationsinWindows9x/ME(thefirsttwofilesarethunk
libraries.TheselibrariesarenotrequirediftheprogramisinstalledonWindows
NT,buttomakeyourinstallationprocessconsistent,youcanincludethem
anyway.
ThelocationoftheThunkDLLshaschanged.Theymustbefoundinoneofthe
following:
thedirectory(searchedfirst)whereyourapplicationresides
thedirectory(searchedsecond)whereyourCrypKeylicenseresides
4 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Iftheydonotresideinoneofthesedirectories,aTHUNK_LIB_NOT_FOUND
errorresults.Windowsandsystemdirectorieswillnotwork.
Note:ForVBandDelphiuserswhenyourunyourapplicationunderthe
IDE(notcompiledstandalone),theapplicationdirectorybecomestheIDE
directory,notthedirectorywhereyourapplicationis.Ifthethunklibraries
areinyourapplicationdirectory,theywillnotbefoundbyCrypKey.We
previouslytoldyoutocorrectthisproblembyputtingtheThunklibrariesin
theWinDirectory,butthisdoesnotworknow.YoushouldputtheThunk
librariesinthedirectorywhereyoutellCrypKeytoputitslicense.
ExtraCRCsecurityisaddedtotheThunklibraries,preventingfilesizesfrom
changing.
InpreviousCrypKeyreleases,whenmultipleversionsoftheprogramusedthe
ThunkDLLs,orwhenCrypKeyprotectedapplicationsran,theseDLLswere
sharedandsometimescrashed.Inthisversion,theDLLsarenotsharedand
consequentlytheDLLsdontcrash.Althoughthereisstillonlyonecopyofthe
DLLs,CrypKeyautomaticallycreatesandrunsacopyoftheDLLsforeach
program.
Youcanachievethisinthreeways:
byputtingtheDLLsinawindowsorsystemdirectory
Note:itisalwaysbettertokeepyourfilesoutofcommondirectories.You
canavoidusingthesysorwindirectoriesbychoosingoneoftheother
methods
byaddingyourdirectorytothepathandrebooting
byalwaysputtingyourfilesinthesamedirectory,e.g.C:\Dan\Danstuff,and
changingthedeclaresinVBaccordingly.Forexamplefrom"Crp32dll.dll"to
"C:\Dan\Danstuff\Cryp32ddll.dll"
C RY P K E Y S D K 4 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Eachmethodhasmeritsanddrawbacks,soitisuptoyoutochoosetheoneto
use.
4 9 C RY P K E Y S D K
U S E R M A N U A L
Demonstration Programs
Demonstrationsareprovidedtoenableyoutotestand Section
3
evaluatetheCrypKeysysteminoperation.Thereare
twodemonstrationprogramsincludedwithCrypKey
SDK6.0WEXAMPLE.EXEandEXAMPLE.EXE.
EXAMPLE.EXEisaWin32basedCrypKeyprotectedprogramthat
W demonstratesallofthebasicfeaturesoftheCrypKeysystem.
EXAMPLE.EXEisanMSDOSbased,CrypKeyprotectedprogramwith
nographicaluserinterface(GUI).Thecompletesourcecodeforbothprograms
isincludedintheCrypKeySDKinstallation.
5 1 C RY P K E Y S D K
U S E R M A N U A L
Asinthenormalauthorizationprocessforyourproducts,theSiteKey
GeneratorisanessentialelementoftheWEXAMPLEdemonstration.Formore
detailsonhowtousetheSiteKeyGenerator,seeSec.4:SiteKeyGenerator.
Procedure
1. UsingtheStartbutton,displaytheCrypKeyprogramgroupshownin
Figure22.
5 2 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3. Intheabovewindow,doubleclicktheWin32 Exampleicontostartthe
WEXAMPLE.EXEprogram.
YourcomputerdisplaystheTESTAPPwindowasshown:
Note:thebuttonsintheTESTAPPwindowperformanumberof
CrypKeyfunctions.Youcanusethesebuttonstotroubleshootthe
operationalstatusofyourCrypKeyinstallation.
4. Clickthefollowingbuttonsinsequence:InitCrypKey(),GetAuthorization()
andGetSiteCode().Asyouclickthesebuttons,thefollowingmessages
appearinthewindowpanelontherightsideoftheTESTAPPwindow:
InitCrypkey() called
INIT OK
GetAuthorization() called
Oplevel = 0
AUTHORIZATION NOT PRESENT
GetSiteCode() called
SITE CODE OK
740A D598 71EC E8E3 35
5 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
TheTESTAPPwindowappearsasfollows:
Intheabovewindow,notethatthesitecode,showninthereturned
messagespanel,isalsodisplayedbelowtheSiteKeyfield.Forexplanations
ofhowtheSiteCodeandSiteKeyaregenerated,andtheirpurpose,seeSec.
4:SiteKeyGenerator.
5. SelecttheSiteCodelocatedbelowtheSite Keyfieldandpress[Ctrl]+[C]
tocopytheSiteCodetotheclipboard.
Youcanusethe[Alt]+[Tab]keystotogglebetweenthetwoprogram
windowsthatarenowactive(TESTAPPSandtheSiteKeyGenerator).
Note:ToplacethingsincontextIntheTESTAPPSwindow,youare
playingtheroleofyourcustomerbyopeninganapplicationthatyouas
thevendorhaveprotectedusingCrypKey.IntheSiteKeyGenerator
window,youareactingasyourselfbyreceivingthesitecodegenerated
bytheCrypKeyprogrambundledwithWEXAMPLE.EXEandentering
thecodeinordertogenerateaSiteKey.
C RY P K E Y S D K 5 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
7. IntheSiteKeyGeneratorwindow,press[Ctrl]+[V]topastethesitecode
(whichyoucopiedtotheclipboardinStep5)intotheSite codefieldand
thenclicktheCheckbuttontoverifythesitecode.Ifthecodeisvalid,the
windowshowsthefollowing:
8. Intheabovewindow,enterthelevel,options,licensetype,andlicense
restrictionasdesired.TheseitemsareexplainedindetailinSection4:Site
KeyGenerator.
5 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
9. ClicktheGeneratebutton.Theprogramgeneratesasitekeybasedonthe
sitecodeandplacesitinthetextboxbesidetheGeneratebutton.
10. Selectthegeneratedsitekeyintheabovewindowandpress[Ctrl]+[C]to
copythesitekeytotheclipboard.
Note:Again,toplacethingsincontextYouareplayingtheroleofyour
customerbyreceivingthesitecodefromthevendorandenteringthe
codeintoWEXAMPLE.UsingtheCrypKeyfunctionbuttonsinthe
TESTAPPSwindow,younowsimulateproductauthorization.
12. ClicktheSaveSiteKey()button.Thefollowingreturnmessageisaddedto
theprecedingmessagesintherightpaneloftheTESTAPPSwindow:
C RY P K E Y S D K 5 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
SaveSiteKey called
SITE KEY ACCEPTED
13. ClicktheGetAuthorization()button.Thefollowingreturnmessageis
addedtotheprecedingmessagesintherightpaneloftheTESTAPPS
window:
GetAuthorization() called
Oplevel = 0
AUTHORIZATION OK
TheTESTAPPSwindowappearsasfollows:
Youhavejustgrantedthedemonstrationprogram,WEXAMPLE.EXE,the
privilegesyouassignedusingtheSiteKeyGenerator.Inanactual
implementation,theseprivilegesapplyonlytoaspecificcopyofyour
application.Youcansendthisauthorizationtoacustomerlocated
anywhereintheworldbyemailortelephone.
5 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. ClickWindowsStart > Programs > CrypKey SDK v6.0.
Thesystemdisplaysthefollowingprogramgrouppopupwindow:
2. Intheabovepopup,doubleclickontheExampleicontostartthe
example.exeprogram.
3. PresstheakeytoactivatetheAuthorizationoption.
4. Writethesitecodeonapieceofpaper.
5. DoubleclicktheSiteKeyGeneratoricontostarttheskw.exeprogram.Use
[Alt]+[Tab]totogglebetweenthetwoactiveprogramwindows.
6. TypethesitecodeintotheSiteCodefieldoftheSiteKeyGenerator.
7. EnterCRYPKEYintothepasswordfield.
C RY P K E Y S D K 5 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
8. Enterthelevel,options,licensetype,andlicenserestrictionasdesiredand
clicktheValidatebutton.Theseitemsareexplainedinmoredetailin
Section4:SiteKeyGenerator.
9. Writethesitekeyonapieceofpaperandpress[Alt]+[Tab]toreturnto
example.exe.
10. Typethesitekeyintoexample.exetoauthorizetheprogram.
Youhavejustgrantedexample.exetheprivilegesyouassigned.Inanactual
implementation,theseprivilegesapplyonlytoaspecificcopyofyour
application.Youcanfaxortelephonethisauthorizationtoacustomer
anywhereintheworld.
5 9 C RY P K E Y S D K
U S E R M A N U A L
Site Key Generator
CrypKeySDKsSiteKeyGeneratorenablesyouto Section
4
authorizeclientstouseyourproduct.
I ntegraltoCrypKeySDK,theSiteKeyGeneratorcreatesthekeysthatunlock
yourproduct.Youcanlimitthenumberofdaysorrunsoverwhichclients
canuseyourproductorimplementtheunlimitedusageoption.Youcan
alsospecifythenumberofprogramcopiesthatcanbemadeandthenumberof
concurrentnetworkusersthatareallowed.Inaddition,youcanreviewprevious
transactionsandsortthembydate,customerorproductname,andreview
archivedlogfiles.
ThecombinedtotalnumberofbitsthatcanbeusedforCrypKeylevelsand
optionsis32.However,youcontrolwhatportionsofthistotalareassignedto
levelsandoptions.Forexample,youcouldimplement28options(eachoption
usesonebit)foryourproduct,keepinginmindthatonlyfourbitswould
remainforimplementinglevels.
Withinthisframework,yousetarangeoflevelsandoptionsforeachproduct
usingtheSiteKeyGeneratorConfiguretabpage(see4.3.2:ConfiguringYour
Products).Whenyourcustomerrequestsalicenseauthorizationforaproduct,
usetheSiteKeyGeneratorto:
selectalevel(onlyoneoftheavailablelevels)andoptionsspecifyingwhat
accessyouareprovidingtothecustomerforthatproduct
6 1 C RY P K E Y S D K
U S E R M A N U A L
issueasitekeytothecustomer,whichincorporatestheselectedleveland
options
Thecustomerentersthesitekeyintoyourprotectedapplicationonhisorher
computer.Thelevelsandoptionsinformationencodedintothesitekey
becomeapermanentpartofthecustomerslicense,whichdefinesthe
customersprivilegesfortheapplication.
4.1.1 Levels
Withlevels,youcanchooseonefeatureorstyleyouwantyourclientstohave.
Forexample,youcandivideyoursoftwareintobeginner,intermediate,and
expertlevels.
Alevelisanintegernumberthatcontrolsavarietyoffeaturesinyourproduct.
Forexample,youmaydevisethefollowingdefinitions:
Level0:noadditionalmodulescanbeused
Level1:thegraphicmodulecanbeused
Level2:thegraphicandprintingmodulescanbeused
Levelscanalsobeusedforversioncontrol.Forexample,youmaydecidethat
thefirstversion(v1)ofyoursoftwarerunsregardlessoflevel,whilev1.1requires
Level1andv1.3requiresLevel2.Levelstrategiesrelatingtoversionsare
numerous,butyoucanchooseonelevelatatime.ConfigurelevelsintotheSite
KeyGeneratorusingtheConfigurebutton.
4.1.2 Options
Withoptions,youcantoggleonoroffoneormoredifferentfeaturesofyour
product.
Anoptionisasinglebitusedlikeanon/offswitch.Forexample,ifyouwantto
offerclientsamodulethatallowsyourproducttoperformprintoutsforan
additionalfee,youcreateanoptionsimilartothis:
Option1(on):themodulecanberun
Option0(off):themodulecannotberun(amessageappearsnoting
thatthisoptionhasnotbeenpurchased)
6 2 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Upto32optionscanbeusedinCrypKeySDK.Tocreateasitekeyenables
options,usetheSiteKeyGeneratorsConfigurebutton.
Thereareprogramsareavailableonthemarketthataredesignedtotryto
deceivetimerestrictedsoftwareprotectionsystems.Theseprogramsautomate
theprocessofchangingacomputer'sclockinordertobypasstimerestricted
protection.Theseprogramschangethetimeregisteredbytheprotected
program.Forexample,iftheregisteredtimeneverextendsbeyondyour
program'strialperiod,ausercanintheoryrunyourprogramindefinitely.
6 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
CrypKeysafeguardsagainstclockmanipulationsbymonitoringyour
customers'computersfortheinconsistenciesgeneratedbysuchanattack.
CrypKeydetectswhentimeisfalselyreportedtoyourprogramandprevents
yourprogramfromrunning.TimereportedbyCrypKeyisthatoftheserver,
adjustedtothelocaltimezoneofthecomputer.
CrypKeymayalsodetectclockmanipulationifusersadjusttheircomputer
clockbymorethanseveralhours,evenforbenignpurposessuchastesting.If
yourprogramispreventedfromrunninginthesesituations,yourcustomercan
correctthesituationbyrebootingthecomputer.
4.2.2 EasyLicense
Somecustomersneedthesimplestpossibleformofcopyprotectionwhena
particularapplicationrunsonlyonaparticularcomputer.Thesecustomersdo
notwanttodealwithanyassociatedissuesoftransfer,networklicense,trial
period,ornumberofcopies.Whetherthesoftwareisoffloadedandputback,
deletedandrestoredlater,ortheentireharddriveiserasedandrestored,the
applicationstillrunsonthecomputer.EasyLicensemeetstheserequirements.
ThefeaturesofEasyLicenseinclude:
Clientscanbackuptheirlicensesandrestorethemlater.
Thelicensefilescanbemovedwithoutaffectingthelicenseitself.
Thelicensetransferabilityisdisabledtopreventabuse.
TheonlylicensetypeavailableforEasyLicenseisanunlimitedlicense.
EasyLicenseworksonanysystemthatsupportsCrypKeysHDSNtechnology.
ApartfromtheEasyLicensetypeoflicense,itisnotpossibletobackupor
restoreCrypKeylicenses.ThereasonforthisisthattheothertypesofCrypKey
licenses(thosewithtimeorrunrestrictions)aretransferablebytheuserandthe
availabilityofbackuprestorewouldallowtheusertoduplicatetheselicenses.
However,theEasyLicenseisnottransferableand,consequently,itcanbe
backedupandrestored.YoucanthinkofEasyLicenseasapermanent
authorizationofaprogramforaparticularharddrive.
C RY P K E Y S D K 6 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedures
ItissimpletobackupandrestoreavalidEasyLicense.
To back up EasyLicense:
Copythefollowingfilestoasafeplace(floppydiskoranothercomputer):
yourfilename.key
yourfilename.rst
To restore EasyLicense:
Installthesoftware,ifitisnotalreadypresent,andsimplycopytheabovetwo
filesbacktothedirectorywheretheycamefrom.Ifthesoftwareisonthesame
harddriveasitwaswhenthelicensewasbackedup,thelicenseisrestored.
MostmodernIDEharddriveshaveburnedinserialnumbers(HDSN).The
HDSNisapermanentreadonlyattributeofapersonalcomputerharddrive,
ratherthantheeasilychangedvolumeserialnumber.TheHDSNisvery
difficulttoaccess,buttheCrypKeySDK6.0withCloneBusterTMtechnologyhas
thisability.UtilizingCloneBusterTM,CrypKeydetectsandlogstheHDSN,model
number,andfirmwareidentifierandusesthisinformationinitsproprietary
licensingalgorithms.ThisensuresthatyourCrypKeyprotectedapplications
arenotfraudulentlytransferredtounauthorizedcomputers.
6 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 6 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
OnceyouhaveobtainedyourSiteKeyGeneratorlicense,themainSiteKey
GeneratorwindowappearswhenyouselecttheSKW icon:
6 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. Receivethecustomerssitecodegeneratedfromyourinstalledapplication.
2. StarttheSiteKeyGenerator,usingtheSKW icon.Thesystemdisplays
theCrypKeySiteKeyGenerator6.0Window.
3. Optionally,typeinthecustomername.
C RY P K E Y S D K 6 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
4. IntheSite codefield,typeinthesitecodeprovidedbythecustomer,then
clicktheCheckbutton.Thewindowappearsasfollows:
6 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 7 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
TheHDSNexistsonmostcomputers.IfCrypKeyhasaproblemfindingor
readingtheHDSN,theserialnumberisshownasunavailableintheHDSN
Informationwindowabove.
Youcandoubleclickanyinformationentrylineintheabovewindow,to
displaytheLicenseDetailswindowshownbelow:
YoushouldrecordtheHDSNinformationforfuturereference.Forexample,
itishelpfulforverificationpurposesintheeventthatyourcustomerasks
youforreauthorizationfollowingacomputercrash.
6. Verifythelicensetermsgeneratedfromyourapplicationatyourcustomers
computer.Youcanchangethelicenseduration,expressedasunlimited,
days,orruns(fordetails,seethenextsection,ConfiguringYourProducts).
7. IntheLevelbox,clickthedropdownarrowtoassignoneofthelevels(if
any)thatwerepredefinedduringtheproductconfiguration.
7 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
8. IntheOptionsbox,clickthecheckboxesbesidetheproductoptionsthat
youwishtoactivateforthecustomer.
9. ClicktheGeneratebutton.
Thesystemgeneratesa26characteralphanumericvalueandplacesitin
theboxbesidetheGeneratebutton.Thisisthesitekeythatyousendto
yourcustomer.Itcontainsallofthespecificationsyouhaveentered
concerninglicenseterms,level,andoptions.
WhenyourcustomerreceivesthesitekeyandentersitintotheCrypKey
windowoftheinstalledapplication,thecustomerisauthorizedtousethat
applicationunderthelicensetermsdefined.
C RY P K E Y S D K 7 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. IntheCrypKey Site Key Generator 6.0Window,clicktheConfigurebutton.
ThesystemdisplaystheConfigurewindow:
7 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2. Ifyouareeditinganexistingproductfile,clicktheapplicablenameinthe
Applications listandproceedtoStep4.
Ifyouareconfiguringanewproduct,clickNewintheabovewindow.The
systemdisplaystheConfigurewindowwiththeNew Applicationpopup
superimposedontoit:
C RY P K E Y S D K 7 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3. TypetheproductsfilenameintotheblankfieldandclickOK.Thepopup
windowdisappearsandthenameyouhavetypedisdisplayedinthe
Applications list,asshown:
Youcanrenameordeletethenewentry,oranyexistingentry,byclicking
thenameinthelist,thenclickingtheRenameorDeletebutton.
4. IntheIDfield,enterauniqueproductidentifier.Forexample,enter1ifyou
areconfiguringyourfirstproduct.
5. IntheLicense Defaultstabpage,setthedefaultrestrictionsforthe
product.NotethatthelicenseautomaticallydefaultstoFixedifyoudo
notspecifyanetworklicense.
Thecheckboxchoicesareasfollows.Thesearedefaultsforthespecified
productandcanbechangedasneededforspecificcustomers.
EasyLicenseunlimitedlicensewithnorestrictions
7 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Networked licenseusediftheapplicationistoberunbyoneormore
usersconnectedtoaserver.
License countmaximumnumberoffixedorfloatinglicensesthata
customercanhaveforthespecifiedproduct.
Durationamountofusageallowedunderthelicense.Thiscanbe
unlimited(thedefault)orcanbeexpressedinnumberofdaysorruns.Ifyou
selectdaysorruns,thenumberboxtotherightbecomesactiveandyouare
abletoenterthenumberofdaysorrunsallowedforthelicense.
Passwordthepasswordtobeusedbyyourcustomer.Apassword
specifiedhereisrequiredintheCrypKey Site Key Generator 6.0Window
whenyouaresubsequentlygrantingalicense.
C RY P K E Y S D K 7 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
6. ClicktheOptionstabtodisplaytheOptionstabpage:
7 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Intheabovewindow,clickthecomboboxarrowstoincreaseordecrease
thenumberofoptionstobeassignedtotheproduct.Asyouincreasethe
number,blankoptionentriesappearintheOptionnamessubwindow,as
shown:
Toassignanametoanoptionnumber,clicktheoptionscheckbox,type
thenameinthetextboxatthebottomofthewindow,andclickthe
Renamebutton.
7. Clickthecheckboxesbesidetheoptionsthatyouwishtoassigntoalicense.
C RY P K E Y S D K 7 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
8. ClicktheLeveltabtodisplaytheLeveltabpage:
7 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Intheabovewindow,clickthecomboboxarrowstoincreaseordecrease
thenumberofoptionstobeassignedtotheproduct.Asyouincreasethe
number,blankoptionentriesappearintheLevel namessubwindow,as
shown:
Toassignanametoalevel,clickonanentrynumber,typeanameinthe
Descriptiontextbox,andclicktheRenamebutton.
Note:onlyonelevelcanbeassignedperlicense.
C RY P K E Y S D K 8 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. ClicktheSKW iconintheCrypKeyprogramgrouptodisplaytheSiteKey
Generatormainwindow.
2. EnteravalidsitecodeintotheSite Codefield.
4. Specifylevels,options,anddurationofthelicense.Thesechangesare
addedtothelicenseforthecustomerwhoprovidedthesitecode.
5. ClicktheGeneratebuttontoproduceanewsitekeyforthecustomer.
8 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Thebenefitofbringingdistributorsintoyourbusinessplanpertainsto
increaseddistributionandsalesofyourproduct.Distributorsauthorizetheir
clientstorunyourproduct,basedonthenumberofruns,days,orcopiesyou
specify,expandingyourworldwidemarketbase,hasslefree.
ToobtainauthorizationfortheDAL,sendusthesitekeyfromyourSiteKey
Generatoronceyouhavepaidforthisfeature.
Note:AsingleslaveSKGcanissueonlyonetypeoflicenseeitherrunsor
daysbased,butnotboth.Forexample,ifyouwantyourdistributortoissue
10dayand10runtypelicenses,thenyoumusthavetheminstallcopiesof
theskw.exeandskw.inifilesintoseparatedirectories,licensingeachslave
SKGforaspecificlicensetype.
ThenumberoflicensesthataslaveSKGcanissueisbasedontheusagecount.
EachtimetheslaveSKGgeneratesakey,itdecrementsitsusagecount.The
usagecountofaslaveSKGisregulatedbythedurationsettinginthemaster
SKG.Theeffectsofvariousdurationsettingsandtheusagecountaredetailedin
Table2.
ThelicensecountshouldbesetintheMasterSKGto1,unlessyouareissuinga
networklicensefortheSKGslave.Thelicensecountisthenumberofuserswho
cansimultaneouslyrunthelicensedapplication.
C RY P K E Y S D K 8 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Ifyourapplicationhasanonnetworklicense,thenthelicensecountrepresents
thenumberoflicensesavailabletobetransferredout.Forexample,ifyou
licenseProductXasanonnetworkapplicationwithalicensecountof3,the
usercouldmakeacopyoftheprogramontwoothercomputersandtransfera
licensetoeachofthem,makingatotalofthreelicensedcopies.
8 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. SendyourdistributoracopyoftheSiteKeyGenerator.ThiscopyoftheSite
KeyGeneratorisunauthorizedatthisstage.
2. Tellyourdistributorto:
a) RuntheunauthorizedcopyofyourSiteKeyGenerator.
C RY P K E Y S D K 8 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
b) ClickLicenseintheSiteKeyGeneratorLicenseAuthorizationdialog
boxtodisplaythefollowingdialogboxshowingthesitecode:
c) Provideyouthesitecode(viaemailortelephone).
3. TypethesitecodefromyourdistributorsslaveSiteKeyGeneratorintothe
SiteCodefieldinyourmastercopyoftheSiteKeyGenerator.
4. IfthewordMUNCHKINdoesntalreadyappearinthepasswordfield,type
itin.
8 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
5. ClicktheCheckbuttoninyourMasterSKG.Afterafewseconds,itappears
asfollows:
Intheabovewindow,theProductfieldshouldreadskw.exe,whichisthe
SiteKeyGeneratorexecutablefile.TheMaster Copyoptionisselectedby
defaultintheOptionspanel.
6. IntheOptionspaneloftheabovewindow,selecttheproductsthatyou
wanttoenable.Youmustenableatleastoneproduct,keepinginmindthat
theavailableoptionsshouldalreadyhavebeensetupintheConfiguretab
page.
Note:whenlicensingaslaveSKG,youshoulddeselecttheMaster
Copyoption.Ifyouleaveitselected,youareauthorizingaMasterSKG,
therebyallowingadistributortocreatetheirownSiteKeyGenerators
withthecapabilityofissuinglicensestodistributors.
C RY P K E Y S D K 8 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
7. ClickGeneratetocreatethesitekeyforyourdistributor.YourMasterSite
KeyGeneratornowappearsasfollows(exampleselectedoptionsare
shown):
Figure 45: Master Site Key Generator with Slave Site Key
and
Selected Options
TheserulesapplyinthesamewaytotheDays Onlyoptionanddays
license.
8 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
8. Sendthegeneratedsitekeytoyourdistributor.
9. YourdistributorentersthesitekeyintotheLicensewindowofhisorherSite
KeyGenerator:
C RY P K E Y S D K 8 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
10. YourdistributorclickstheValidatebuttonintheabovewindow,resulting
inauthorizationoftheslaveSKGasshown:
YourdistributorisnowauthorizedtousetheSiteKeyGeneratortoissue
customerlicensesforhisorherproducts.Notethatthelicensedurationis
thesameasspecifiedintheMasterSKG(Figure45).
Youshouldntneedtocontactyourdistributoragainconcerningissuesof
licensevalidation,unlessthedistributorsharddrivecrashesorheorshe
loseauthorization.
8 9 C RY P K E Y S D K
U S E R M A N U A L
Programming Your Application
ThestandardprocessforimplementingCrypKey Section
5
involvesprogrammingtheSLAPIlibraryfunctions
intothesourcecodeofyourapplicationandproviding
theinterfacetoyourclients.
T hecompileandlinkprocedureisthefinalstageoftheprocess.SeeSection
13:AppendixISampleFileforanexample.Therearemanyotherpieces
ofsamplecodeavailableinyourCrypKey6.0sampledirectory.
CrypKeySDK6.0operatesverymuchasthepreviousversion,withthe
exceptionthatthe.ngnfileisrequiredinyourapplicationdirectory.Ifyoudont
includethisfile,errorsinthe200rangewilllikelyresult.
1. CalltheInitCrypkey()function.
ThisfunctioninitializestheCrypKeysystemwiththepathofthefileto
checkforauthorization.Callitonopeningtheapplicationorstarting
theprogram,toinitializeCrypKey.
Thisfunctionreturns0ifsuccessful(CrypKeyinitialized)andreturnsa
negativevalueifunsuccessful(CrypKeynotinitialized).Ifthe
InitCrypkey()functionreturnsanegativevalue,displayanerror
messageanddisableorlimittheprogramasdesired.Youmayfindit
helpfultousetheExplainErr()functionwiththefailurecodetoretrieve
theappropriateerrormessage).
9 1 C RY P K E Y S D K
U S E R M A N U A L
NotethattheInitCrypkey()andGetAuthorization()functionsmustbe
calledatleastoncebeforeanyotherCrypKeyfunctionsarecalled.
FordetailsontheInitCrypkey()function,seethedescriptioninSection
12.3.26:InitCrypkey().
2. CalltheGetAuthorization()function.
TheGetAuthorization()functioncheckswhetherornottheprogramis
authorizedtorunandreturnsthelevel/optionsinformationifthe
programisauthorized.Thefunctionisalsousedtoincrementthecount
ofrunsused.
Callthisfunctiononopeningtheapplicationorstartingtheprogram,to
checkwhetherornottheuserisauthorizedtoruntheprogram,andcall
itwheneveryouneedtochecktheleveloroptionsettingfortheusers
license.Callthisfunctionasoftenaspossibleinordertostrengthenthe
securityofyourapplicationevenfurther.
Thisfunctionreturns0ifsuccessful(programauthorized),anegative
valueifunsuccessful(programnotauthorized),orapositivevalue
(signifyingthattheprogramhasamultiuserlicenseandmoreusersare
requestinguseoftheprogramthanthelicenseallows).
IftheGetAuthorization()functionreturns0,proceedtostep3onlyif
theuserwantstochangethelicensepermissions.
IftheGetAuthorization()functionreturnsanegativevalue,displayan
errormessageinformingtheuserthattheprogramisnotauthorized,
optionallywithanexplanation(youmayfindithelpfultousethe
ExplainErr()functionwiththefailurecodetoretrievetheappropriate
errormessage).Continueasoutlinedinstep3toprompttheuserto
authorizetheprogram,possiblyatalatertime(i.e.,offamenuitem
command).
IftheGetAuthorization()functionreturnsapositivevalue,whichisa
queuevalueindicatingthenumberofuserswhomustquitthe
applicationbeforealicensebecomesavailable,continuerepeatingcalls
toGetAuthorization()untiltheusergetsalicenseorgetstiredof
waitingandquits.
9 2 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
NotethattheInitCrypkey()andGetAuthorization()functionsmustbe
calledatleastoncebeforeanyotherCrypKeyfunctionsarecalled,and
GetAuthorization()mustalsobecalledrepeatedlyatregularintervals
whennetworklicensingisineffect.
SeetheGetAuthorization()functiondescriptioninSection12.3.13:
GetAuthorization()formoredetails.
3. CalltheGetSiteCode()function.
Thisfunctiongetsthesitecodefortheprogram.Callitwhenyouwant
toauthorizeanewlicenseorchangethecurrentlicensepermissions.It
returns0ifsuccessful,meaningthatthesitecodeisreturned,orreturns
1ifCrypKeyisnotyetinitialized.
Youmustdisplaythesitecodetotheuserinorderfortheusertobeable
toprovideittoyouwhenheorshecallsyoutorequestasitekey(for
instructionsoncreatingthesitekey,seeSection4:SiteKeyGenerator.
Theusercanshutdowntheprogramwhilewaitingforthesitekey;the
sitecodeisnotchangedwhentheprogramstartsupagain.
SeetheGetSiteCode()functiondescriptioninSection12.3.24:
GetSiteCode()formoredetails.
4. CalltheSaveSiteKey()function.
TheSaveSiteKey()functionsavesthesitekeyinformation,which
containsyourproductslicensingpermissionsforthecustomer'ssite.
Encryptedlicensefilesarecreatedfromthisfunctionandsavedonthe
computersharddisk.Callthefunctionaftertheuserhasenteredthe
sitekey.
IftheSaveSiteKey()functionreturns0,anewlicenseiscreatedforthe
customerssite.IftheSaveSiteKey()functionreturnsanegativevalue,
notifytheuserthatthesitekeyisinvalid.Youmayfindithelpfultouse
theExplainErr()functionwiththefailurecodetoretrievethe
appropriateerrormessage.
Notethatifthesitekeyissavedsuccessfully,thesitecodechanges.This
isdonetopreventtheuserfromreusinganoldsitekey.Ifyougivethe
userasitekeythatallows10runs,youdontwanttheusertoreusethat
9 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
oldkeylaterforanother10runs,evenifrecyclingisgoodforthe
environment.
SeetheSaveSiteKey()functiondescriptioninSection12.3.32:
SaveSiteKey()formoredetails.
5. CalltheEndCrypkey()function.
TheEndCrypkey()functionensuresthatthelicensingcontrolsystem
terminatescleanlywithouterrors.Callthisfunctionjustbeforeexiting
theprogram.Thereisnoreturnvalue.
NotethatifEndCrypkey()isnotcalledbeforetheprogramterminates,
variouserrorsmaybeencounteredthenexttimetheprogramisstarted
andtheInitCrypkey()functioniscalled.
SeetheEndCrypkey()functiondescriptioninSection12.3.7:
EndCrypkey()formoredetails.
Procedure
To authorize the program:
1. ExecutetheGetSiteCode()function.
2. Checkthereturnvalueandcodetheappropriateresult(i.e.,disablethe
program).
3. OpenawindowpassingthesitecodeobtainedfromtheGetSiteCode()
functiontotheuser.
C RY P K E Y S D K 9 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
4. EnterthesitekeyinthewindowandpressesanOKbutton.
5. ExecutetheSaveSiteKey()function.
6. Checkthereturnvalueandcodetheappropriateresult(i.e.,disablethe
program).
Procedure
1. Openawindowrequestingthedirectorypath.
2. Theuserentersorselectsthedefaultpathinthewindowandpressesan
OKbutton.
3. ExecutetheRegisterTransfer()function.
4. Checkthereturnvalueandcodetheappropriateresult(i.e.,disablethe
program).
Procedure
1. Openawindowrequestingthedirectorypath.
2. Theuserentersorselectsthedefaultpathinthewindowandpressesan
OKbutton.
3. ExecutetheTransferIn()function.
4. Checkthereturnvalueandcodetheappropriateresult(i.e.,disablethe
program).
9 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. Openawindowrequestingthedirectorypath.
2. Theuserentersorselectsthedefaultpathinthewindowandpressesan
OKbutton.
3. ExecutetheTransferOut()function.
Procedure
Includecrypkey.hinallmodulesthatmakecallstotheCrypKeylibrary.Ifyou
areusingtheCRP32DLL.DLLwithaCorC++module,youmustincludethe
followingstatement:
#defineDLL
5.3.2 Linking
Linktheappropriatelibrarytoyourapplication,dependingonthecompiler
andplatform.AlllibrarieshavebeencompiledusingtheLargememorymodel.
CrypKeyrequiresamplestackspaceyoushouldallowatleast10K.
Thetablebelowdescribestheavailablelibraries.Seealsothenotesfollowing
thetable.
C RY P K E Y S D K 9 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Table 3: Libraries
Library Compiler Platform Type
CRYPKEYCOM. All compilers that Win32 COM Object
DLL can use COM
objects
CrypKeyNET.DL All compilers that .NET .NET assembly
L can use .NET Framework
objects
LCRYPKB.LIB Borland MS-DOS 16-bit Static library
LCRYPKY7.LIB Microsoft C 7.0 MS-DOS 16-bit Static library
LCRYPKYM.LIB Microsoft C Win16 Static library
7.0/VC++
LCRYPKYD.LIB Microsoft C Win16 Import library for
7.0/VC++ DLL
LCRYPKYD.DLL Any Win16-based Win16 Dynamic link
compiler library
LCRYPKYB.LIB Borland C++ Win16 Static library
CRP32S42.LIB Microsoft VC++ Win32 Single-thread
up to 5.x static RT library
CRP32D42.LIB Microsoft VC++ Win32 Multi-thread
up to 5.x dynamic C RT
library
CRP32M42.LIB Microsoft VC++ Win32 Multi-thread
4.2 static RT library
CRP32D60.LIB Microsoft VC++ Win32 Multi-thread
6.0 dynamic RT
library
CRP32M60.LIB Microsoft VC++ Win32 Multi-thread
6.0 static RT library
CRP32S60.LIB Microsoft VC++ Win32 Single-thread
6.0 static RT library
CRP32DLL.DLL Any Win32-based Win32 Multi-thread RT
compiler library
CRP32DLL.LIB Microsoft VC++ Win32 Import library for
4.2 CRP32DLL.DLL
CRP32BST.LIB Borland C++ 4.51 Win32 Single-thread
static library
9 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Note:IfyouareusingMicrosoftVC++inaWin32applicationthatdynamically
linkstoWindowsCruntimelibrary,youmustuseCRP32D42.LIBor
CRP32D60.LIB;otherwise,youlinkerrorswillresult.
CrypKeycanalsobeusedwithinnonCapplicationsbyapplyingthedynamic
linklibrary(DLL).
Library Notes
Ifyouaregettingunresolvedexternalsormultipledefinedexternals,its
probablethatyouarelinkingtothewronglibraryorhaveamodelcombination
thatwedonotsupport.
MicrosoftVisualC(MSVC)allows:
singleormultiplethreads
staticordynamicallylinkedruntimelibraries
ThereisadifferentCruntimelibraryforeachcombinationofthesepairsand
thecompilerautomaticallylinkstothecorrectoneforyou.
YoumustalsomakeadifferentCrypKeylibraryforeachcombinationandtell
thecompilerthecorrectonetolinkto.
MostMSVCsampleprojectsdefaulttomultithreadanddynamicruntimeCLib
(CRT),whichisacombinationwedon'tsupport.Werecommendthe
combinationofmultithreadwithstaticlibraries,asfewerproblemsoccurwith
thismodel.
C RY P K E Y S D K 9 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
CrypKeyusesthreeofthepossiblefourmodelcombinations.Thefollowing
tableshowsthelibrarynamesandthecombinationsforwhichtheyareused:
1. Ensurethatyourapplicationisabletomakecallstodynamiclink
libraries.Refertodevelopmentsystemsmanualforinstructionsonhow
tocallandlinkDLLfunctions.
2. Declare/defineyourexternalCrypKeyfunctionswithinyour
application.
3. Sinceyouareunabletousethecrypkey.hlibraryfile,whichcontains
errorhandlingvariabledeclarations,youmayusetheintegervalue
providedwithinyourprogrammingordeclareyourownvariables
withinyourapplication.
4. Ensurethatyouhaveinstalledthelcrypkyd.dllorcrp32dll.dlllibraryfile.
Youmustincludethisfilewithyourinstallationdisks.
5. CalltheCKChallenge()functiontoensurethatthefileCRYP32DLL.DLL
hasnotbeenreplacedwithanimpostor.Thisfunctionrequirestwo
additionalsecretnumbersthatareprovidedwithyourdeveloperkeys.
Youcanusethenumbersinexample.cfortestingpurposes.
Thesecretnumbersarethepasswordnumberandthecompany
numberyoureceivewithyourmasteranduserkeys.Followingisan
examplesetofthesenumbers.
9 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
TheMasterKeyforEXAMPLE.EXE,company7956123,product1,
Floating:Y,NT:Y,NT_32_Bit_Lib:Y,is:
2A5D57C4E91DB05BF06CB4F760F98E70791A51751834
TheUserKeyforcompany7956123is:
D050815CD1A2A79DB1
Thepasswordnumberis:
984534120
UsingDynamicLinkLibraries(DLLs)withVisualBasicandotherlanguageshas
alwaysbeenadifficulttask.SinceLIBsareencapsulatedinaCOMobject,the
incorporationofCrypKeySDKfunctionsintoanapplicationbecomesmuch
easier.ThisisparticularlytruewithVisualBasic(VB),whereCOMsupportis
builtin.COMobjectsarealsosupportedbyC++,Java,andwebdevelopment
toolslikeIIS(InterDev)andColdFusion.
Note:.NETassembliesaresimilartoCOMobjectsandareusedin
essentiallythesameway.However,.NETassembliesareavailableonlyto
.NETlanguages(VB.NET,C#.NET,C++.NET).
ForeachCrypKeyfunction,youwillfindtheprototypesusedinC,C++,VBand
C#.NETinSec.12.3:FunctionDescriptions.
TheCprototypeisforusewiththeCrypKeyLibrary.
TheC++andVBprototypesareforusewiththeCrypKeyCOMObject.
TheC#.NETprototypeisforusewiththeCrypKey.NETassembly.
C RY P K E Y S D K 1 0 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. Switchtothedirectoryintowhichyouareinstallingthefiles.
2. Executethefollowingcommand:
regsvr32 CrypKeyCOM.dll
YouarenowreadytousetheCOMobjectfromanywhereinthesystem.Youdo
nothavetocopytheCOMobjectfileorregisteritmorethanonce.
TherearetwomethodsofusingtheCOMobjectwithVisualBasic:
referencingtheCOMObjectexplicitly
referencingtheCOMObjectbyname
Theabovemethodsaredescribedinthesectionsthatfollow.
Athirdmethod,alsodescribedbelow,usestheCOMobjectinC++.
1 0 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 0 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Tousethismethod,nospecialprojectsetupisneeded.Youcanwriteyourcode
exactlyasshowninSec.5.4.3,exceptthatthefirsttwolinesarereplacedwith
thefollowingfourlines:
Therestofthecoding,startingwithCrypKeyinitialization,issimilartothat
showninSec.5.4.3,withminormodifications.
Tousethismethod,youmustdefineeachfunctionintheCrypKeySDKDLL
thatyoucallandensurethattheDLLisintheapplicationorsystempath.This
methodismoreconfusingandpronetoerrorsthanusingaCOMobject.It
lookssomethinglikethisinVB:
1 0 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Therestofthecoding,startingwithCrypKeyinitialization,issimilartothat
showninSec.5.4.3,withminormodifications,usingaCOMObjectinC++.
{
// create an instance of the COM object
ICrypKeySDKPtr ptr;
ptr.CreateInstance ("CrypKey.SDK");
C RY P K E Y S D K 1 0 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
{
// check if we are authorized
long nAuthResult;
long nOptLevel;
nAuthResult = ptr->GetAuthorization (&nOptLevel,
1);
1 0 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Datatype:CKExplainEnum
C RY P K E Y S D K 1 0 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Datatype:CKRestrictionTypeEnum
CKRestrictionTypeNone0 licensewithnorestrictions
CKRestrictionTypeTime 1 licensewithatime(numberofdays)
restriction
CKRestrictionTypeRuns 2 licensewitharuns(numberofruns)
restriction
Datatype:CKBooleanValueEnum
ConditionName Value
CKBooleanFalse 0
CKBooleanTrue 1
Datatype:CKMaxLengthEnum
Parameter Value
CKMaxLenComputerName 15
CKMaxLenUserName 15
1 0 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 0 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 0 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 1 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
RatherthanmakingtheCrypKeycallsyourself,yourprogramneedonlywritea
requestfile,callcui.exe,andreadthereplyfileleftbycui.exe.Theadvantagesof
usingthistypeoflinkare:
YourprogramissmallersincetheCrypKeylibraryisnotlinkedtoit.
YoudonotneedtoprogramtheCrypKeyinterface,sincetheCrypKey
UserInterfaceexecutablehandlesthisforyou.
YoucanuseCrypKeyfromprogramsinanylanguageorcompilerthat
canwriteabinaryfile.
1 1 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 1 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Theinformationyouaresendingtoandreceivingfromcui2.exeisthesame
informationasdescribedintheCrypKeyfunctioncalls.
To transfer information:
1. AssembletheinformationrequiredintothePassedOutstructure,
includingtworandomnumbers.
2. Writetheinformationtoafilenamedcui2_infile.tmp.
3. Runtheprogramcui2.exeandwaitforittocomplete.
4. Oncecui2.execompletes,readintheinformationfromafilecalled
cui2_outfile.tmp.
5. PerformtheCKChallenge()calculationandcomparethistothe
numberthatwaspassedout.
6. Theinformationfromthisfilecanbeusedasifitcamefromthe
CrypKeyfunctioncalls.
Thetestcodeandcui2.exeareautomaticallyplacedinthe
Crypkey.60\External\Cui2directorywhenyouinstallCrypKey.
Testcui2.c/testcui2.exeisanexampleprogramwritteninCthatuses
externallinking.Cui2.hisaCrepresentationofthestructurespassedinand
outofyourprogram.
1 1 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Thissystemhasthefollowingfiles:
CUI2.EXE DOS"CrypKeyUserInterface"externallicensemanager
CUI2.C sourcecodeforCUI2.EXE
CUI2.MAK MSC7.0makefileforCUI2.EXE
TESTCUI2.EXE sampleexternallylinkedDOSprogram
TESTCUI2.C sourcecodeforTESTCUI2.EXE
TESTCUI2.MAK MSC7.0makefileforTESTCUI2.EXE
CUI2.H headerfilewithinformationforlinkingwithCUI2.EXE
ForcompleteinformationonwhatispassedtoandfromCUI2.EXE,see
CUI2.H.TodemonstrateandtestCUI2.EXE,putitinthesamedirectorywith
TESTCUI2.EXE,andthenrunTESTCUI2.EXE.Bothexecutablesarealready
locatedintheDEMOSdirectory.
Note:dontextractthecks.exezipfilesetupex.exeexpectstoseethisfile
asis.
C RY P K E Y S D K 1 1 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
If,forexample,InstallShieldisused,thescriptshouldensurethatboth
setupex.exeandcks.exearecopiedintotheinstallationdirectory(i.e.,the
directorywheretheusersprogramisinstalled).TheInstallShieldscriptonly
callssetupex.exe.
1. intheprocessterminationcode,whichcanbereadbytheprocessthat
launchedsetupex.exe,ifthisissupported
2. if(1)isnotsupported,theerrorcodeiswritteninASCIItoafilecalled
setupex.xco,attermination
Someinstallationprogramsareabletoreceivethiserrorcode.Processingthese
codesisoptional.
Thereportederrorsthatarelikelytobecausedbyabuginyourinstallationare:
#define NTDRVR_INSTALL_ERR_NOT_NT -1
#define NTDRVR_INSTALL_ERR_REMOTE_DRIVE -2
#define NTDRVR_INSTALL_ERR_CANNOT_COPY_FILE -3
#define NTDRVR_INSTALL_ERR_CANNOT_RUN_CKSETUP -4
#define NTDRVR_INSTALL_ERR_CKS_EXE_MISSING -5
#define NTDRVR_INSTALL_ERR_CANNOT_RUN_CKS_EXE -6
#define NTDRVR_INSTALL_ERR_MISSING_FILE -7
Thefollowingerrorisreportedwhenyoudonothavepermissiontoloaddriver
files.
#define NTDRVR_INSTALL_ERR_REG_COULD_NOT_OPEN_ -8
SERVICEMANAGER
ThefollowingerrorsareunlikelytooccurandshouldbereportedtoCrypKey:
1 1 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
#define NTDRVR_INSTALL_ERR_REG_COULD_NOT_OPEN_SERVICE -9
#define NTDRVR_INSTALL_ERR_REG_COULD_NOT_REGISTER_ -10
DIRECTORY
#define NTDRVR_INSTALL_ERR_STARTSERVICE_COULD_NOT_OPEN_ -11
SERVICEMANAGER
#define -12
NTDRVR_INSTALL_ERR_STARTSERVICE_COULD_NOT_OPEN_SERVICE
#define NTDRVR_INSTALL_ERR_STARTSERVICE_COULD_NOT_ -13
START_SERVICE
#define NTDRVR_INSTALL_ERR_STOPSERVICE_COULD_NOT_OPEN_ -14
SERVICEMANAGER
#define NTDRVR_INSTALL_ERR_STOPSERVICE_COULD_NOT_ -15
OPEN_SERVICE
#define NTDRVR_INSTALL_ERR_STOPSERVICE_COULD_NOT_ -16
STOP_SERVICE
#define NTDRVR_INSTALL_ERR_REBOOT_NEEDED -17
Insilentmode(SetupEx.EXE/S),setupex.exedoesnotputmessagesonthe
screen.ItdoescompletecheckingandinstallstheWindowsNTdriverifitcan.If
itcannotinstallthedriver,itreturnsanerrorcode.Sincesilentmodedoesnot
reporterrors,itisuptotheinstallationprogramtohandlethem.Notethatthe
REBOOT_NEEDEDmessageisnotanerror,butratherawarning.
Inverbosemode(SetupEx.EXE),setupex.exedisplaysanyerrorsitencounters.
ItdoescompletecheckingandinstallstheWindowsNTdriverifitcan.Ifit
cannotinstallthedriver,itreturnsanerrorcode.Notethatverbosemode
doesnotreporterrorsonscreenifitencountersWindows95/98/ME,butinstead
doesnothingandsilentlyreturns.
ForanyWin32platform,theeasiestinstallationstrategyistocopythefilesinto
theinstallationdirectoryandrunsetupex.exe.Thedriversetsuptheservice,ifit
shouldbesetup(i.e.,itisalocalWindowsNTdirectory).Ifthereisaproblem,
C RY P K E Y S D K 1 1 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
thedriverreportsittotheuser,therebydoingallthenecessaryinterfacework
foryou.
MoreCompleteMethod
Toprovideamorecompletepackage,youmaywishtoaddsomelogicfor
someonetryingtoinstallontoaserverfromaclient.Althoughyourprogram
maybeinstalledthisway,thedrivercannotandusersmustbewarnedofthis.
Youcanavoidthisissuebydisallowingclienttoserverinstallationsorby
offeringawaytorunonlythedriverinstallontheserver.
ApplyingMoreControl
Ifyouneedmorecontroloveryourinstallation,youcanuseourWindowsNT
installationsilentmodebycallingSetupEx.EXE/S.Youthenmustretrievethe
errorcodesandhandleallerrorsyourself.
Procedure
1. Locatesetupex.exeinthedirectoryyouwanttouninstall.
2. Fromthedirectory,runSetupEx.EXE/D.
Thisperformsallrequiredactions.Ifnootherdirectoriesareusingthedriver,all
driverfilesaredeletedandamessagenotifiestheuserthatthecomputermust
berebootedbeforeanotherinstallationcanbedone.Youcanavoidthis
messagebyusingthesilentmode(SetupEx.EXE/D/S).
Notethatiftheuserattemptsanotherinstallationbeforerebootingandthe
servicewasremoved,thefollowingError9messageappears:
1 1 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Theaboveerrormessagedisappearsafterthecomputerisrebooted.
Ifyouwishtouninstallevenifthereareotherdirectoriesregistered,youcanuse
thSetupEx.EXE /Ucommand.
WARNING:thiscommandleavestheotherregistereddirectorieswithouta
drivertoservethem.Itisrecommendedthatthecommandoption/Dbeused
inreleaseversions,andthatoption/Ubeusedfortestpurposesonly.
Thedrivercanbereinstalledafterthe/Uoptionisrun,butyoumustfirst
reboot.Theotherregistereddirectories,ifanyarepresent,arestillconfigured.
5.6.5 Testing
Forasimpletest,placebothSetupEx.EXEandCKS.EXEinanydirectory,and
thencallSetupEx.EXE.YounowseeyourdirectoryinCyrpkey.ini.Ifthe
CrypKeyNTservicehadneverbeenonyoursystem,youwouldseethattoo.
C RY P K E Y S D K 1 1 8
U S E R M A N U A L
Section
tealthPLUSTMisanimportantcomponentofsoftwaresecurityandthe
S CrypKeySDK.YoumayimplementSDKfunctionsinyoursoftware,but
withoutantihackingprotection,anaverageskilledhackercanquickly
changeyourcodetoskipthesecurity.
Version6.0StealthPLUSTMhasevolvedtothehighestlevelofsecurityyet.
Althoughnoonecanguaranteethatyourprogramcan'tbehacked,wecan
guaranteethatStealthPLUSTMmakesyourprogramextremelytediousand
painfultohack.Anyversionofyourprogramthatishackedwillnotlikely
operateproperly.
StealthPLUSTMisastrongdeterrenttoreverseengineeringandpatching,
helpingtoensurethatthesecuritylogicyouputinyourprogramstaysinyour
program.Inlessthan60seconds,StealthPLUSTMautomaticallyimplementsa
batteryofsecuritymeasuresinyourprogram.
StealthPLUSTMprotectsyourprogramintwoways:
1 1 9 C RY P K E Y S D K
U S E R M A N U A L
1. Itcompressesandencryptstheprogram.Yourexecutablefileissmaller
afteryouhavestealthedit.Sincethecodeisactuallyencrypted,reverse
engineeringanddebuggingofthefilebecomesextremelydifficult.
2. Itguardsagainstpatchingwhileyourprogramisinmemory.Itistechnically
possibletodebugorredirectprogramexecution(patch)aroundthesecurity
codewhileitisinmemory.StealthPLUSTMdetectsdebuggersandpatches
andimmediatelyhaltsprogramexecution.
StealthPLUSTMalsocompletelyrewritesyourprogramandrunsitinmemoryin
smallpieces,minimizingtheamountofcodethatmustbeexposedatanygiven
time.Thisprocessprovidesanextremelystronglevelofprotection.
StealthPLUSTMissimpletouse.Simplytellittheinputandoutputfilepathsand
itdoestherest,rewritingyourEXEorDLLandbuildingtheabovesecurity
featuresintothem.
Foryourconvenience,wehaveincludedtwoversionsofStealthPLUSTM:
Note:ToruneitherversionofStealthPLUSTM,theSiteKeyGeneratormust
beauthorized.
UserInterfaceStealthPLUSTM(Stelthui.exe)
Thisversionhasawindowsuserinterfacethatallowsyoutobrowseand
savetheinputandoutputfilepaths.
CommandLineStealthPLUSTM(Stelthcm.exe)
ThisversionallowsyoutoeasilyautomatetheStealthPLUSTMprocessby
addingStealthPLUSTMtoyourmakefiles.Itacceptstheinputandoutput
pathsascommandlineparameters.TheStealthcommandsyntaxisas
follows:
where{input filepath}istheEXEorDLLyouwanttostealthand
{output filepath}isthestealthedfile.Thefilenamecanbethesameifit
isputinadifferentdirectory.
Thecommandlineversionisdesignedtoallowyoutoautomatethestealth
taskbyaddingittotheendofyourcompilingprocess.Manycompilers
1 2 0 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
supportacustomsteplikethis,soconsultyourcompiler'sdocumentation
forfulldetails.
Procedure
1. CreateasubfoldernamedTreatedunderthefolderthatyourcompiler
outputsthetargetprogramorDLL.
2. IntheVC++IDE,selectthemenuitemProject\Settings,thenscrollthe
tabstotherightuntilyouseeontheCustom Buildtab.
3. Enterthefollowing:
Description: Stealth
Commands: c:\CrypKey.60\stealth\stelthcm.exe
$(InDir)\your.dll
$(OutDir)\treated\your.dll
Note:intheabove,thecommandInDircanbewrittenas
InputDir.Theparameteryour.dllcanalsobegivenas
your.exe.
Outputs: $(OutDir)\treated\your.dll
Note:intheabove,theparameteryour.dll canalsobe
givenas
your.exe.
CompletionoftheabovesequencecausesVC++toputastealthedcopyof
your.dlloryour.exeintheTreateddirectory.
1 2 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
StealthPLUSTMcaneveninstalltheCrypKeyLicenseServiceuponfirstrunfor
you.ForinstructionsonhowtodousethisfeatureofStealthPLUSTM,seeSec.
5.6,CreatingaWindowsNTLicenseServiceInstallation.
TheAutoDistributionfeatureensuresthat:
yourEXEhasallofthefilesitneedstorun,nomatterwhereitis
yourEXEalwaysusesthecorrectversionofassociatedfiles
theNTDriverisinstalled
yourEXEisselfcontainedandeasytouse
C RY P K E Y S D K 1 2 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Procedure
1. IntheCrypKey.60\Stealthdirectory,clickthestealthui.exefilename.The
systemdisplaysthefollowingwindow(withtheSiteKeyfieldblank):
1 2 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2. IntheSiteKeyfield,typeinyourCrypKeySiteKey,andclicktheValidate
button.IftheSiteKeyisvalid,thesystemdisplaysthefollowingpopup
window:
Intheabovewindow,noticethatthesitecodehasnowchanged.Thisis
standardinCrypKey.WhenCrypKeyvalidatesaprogramusingasitekey
generatedfromtheprogramssitecode,itreplacesthesitecodeforthat
program.
C RY P K E Y S D K 1 2 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3. Intheabovewindow,clickOKifyouwishtoproceed.Thesystemdisplays
thefollowingwindow:
4. Intheabovewindow,usethePick Filebuttonstobrowseyourdirectories
andenterthefollowinginformation:
intheProgram to compressfield:thefullpathofthesourcedllor
executablefilethatyouwishtoprotect.
intheOutput programfield:thefullpathoftheprotecteddllor
executablefilethatistobedistributed.Ifyouwanttoplacethisfilein
thesamedirectoryasthesourcefile,youmustuseadifferentfilename.
5. Optionally,selectthecheckboxAutoinstall NT driversifyouwishtohave
StealthPLUSTMautomaticallyinstalltheCrypKeyLicenseServicedrivers
whenyourcustomerinstallsyourproduct.
1 2 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Note:anyCrypKeyfilesplacedpreviouslyinthedirectoryAutoDistare
nowpacked.Iftherearefilesyoudonotneed,simplyremovethem
beforerunningtheStealthPLUSTMinterface.Similarly,otherfilesthat
youhaveplacedintheUserDistdirectoryarenowpacked.
NotethatStelthUI.Exeallowsyoutosavetheconfigurationandspecify
adifferentuserdirectoryforeachEXE.
7. UsethePick folderbuttontoselectthefolderwheretheNTdriversand
autoextractedfilesareplaced.
8. TosaveyourStealthPLUSTMconfiguration,clicktheSavebutton.Ifyouare
notplanningtostealthyoursoftwareduringthepresentsession,youcan
closethiswindow.
9. Whenyouarereadytostealthyoursoftware,clicktheBegin compression
button.
Note:ifyouhavestartedanewStealthPLUSTMsession,having
previouslyperformedSteps1to6,theStealthPLUSTMConfiguration
windowappearsasabove(Figure50),readyforyoutoclickthe
Begin compressionbutton.
C RY P K E Y S D K 1 2 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Thesystemnowdisplaysthefollowingpopupwindow,overlayingthe
StealthPLUSTMConfigurationwindow:
Procedure
Syntax
Thesyntaxforthecommandlineversionofstealthisasfollows:
where
nistheoptionforAutoattachNTdrivers
aistheoptionforAttachandautoextractfilesinagivendirectory
infile andoutfilemustbegivenasdifferentfilenames
Ifapathhasspacesinit,surrounditwithdoublequotes.
1 2 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Results
Whenyourprogramruns,thetemporaryCrypKeyfiles,suchastheNTDriver,
areunpackedtoatemporarydirectory,run,anddeleted.Allotherfilesare
unpackedtotheEXE'sdirectorybeforetheEXEisrun.
Asamplestealthedprogram,togetherwithpackedCrypKeyanduserfiles,is
intheCrypKey.###/Demos/SampleStealtheddirectory.
Notethatrunningthisprogramunpacksallfiles.
Theconfigurationusedtocreatethisprogramissavedasthefirstconfiguration
inStelthUI.Exe.
Note:ThisconfigurationiscorrectonlyifCrypKeyisinstalledto
C:\CrypKey.###.
C RY P K E Y S D K 1 2 8
U S E R M A N U A L
Section
Counter-Hacker Strategies
7
Themeasurespresentedherearenotguaranteed
unbreakable,butaredesignedtodeterlicensesystem
tamperingandrevealtamperingwhenitoccurs.
herearesomemeasuresyoucantakewhendevelopingyoursoftwareto
T helppreventusersfromtamperingwithyourproduct.Ensureyour
softwarerespondswitherrorcodeswhenafunctionfails.
Note:thesemeasuresaredesignedforenvironmentsthatdonotinclude
CrypKeyStealthPLUSTM.Whendistributingyoursoftware,usethe
StealthPLUSTMprogramthatisincludedinCrypKeySDK.Fordetailsonusing
StealthPLUSTM,seeChapter6.
preventthelicensesystemfrombeingcompromisedthroughthe
substitutionofanimpostorlicensesystem(i.e.,onethatalwaysgrants
alllicenserequests)
preventthelicensesystemfrombeingcompromisedthroughmultiple
patches(thereisnosetofpatchesthatcandefeatthelicensesystemfor
allapplications)
1 2 9 C RY P K E Y S D K
U S E R M A N U A L
prevent,throughasetofguidelines,anysingleapplication'slicense
verificationsubsystemfrombeingdefeatedbyanysinglepatch
requireanobviousandintentionalefforttodefeatforeachapplication
Thefollowingguidelinesmaygoagainstsomeacceptedcodingpractices.Itis
yourchoicewhetherornottoimplementthem.
Donotcomparetheauthorizationresultimmediatelyaftercallinga
CrypKeyfunction.Instead,savetheresultandcompareitlater.Thisis
securitybyobscurity.
Doanextracheckonauthorizationinsomeobscurebutfrequently
usedpartoftheprogram.Iftheresultisunauthorized,obtainthe
systemtime,donothinguntilthetimeisanevenmultipleof5(for
example),andthendisablesomethingimportant.
CalltheCKChallenge()function,especiallywhenusingaCrypKeyDLL
orexternallinking.Thisisaverydifficultfunctiontohack.
Incorporateaninternalandobscurechecksumoverthecodethatdeals
withthelicensesystemandwiththeverification.Obscurethechecksum
codeifyoucan.
Ifapplicable,takeoveranydebugandsinglestepvectorsthatmightbe
usedbydebuggers.Takegreatcarewhenusingsuchanadvanced
measure.
Addrandomitemstotheapplication,suchasmeaninglessreads,
compares,andsubtractions.Insituationswhereahardwaremonitoris
used,thismayincreasethenumberofhardwarebreakpointsthatoccur.
Verifytheresultmorethanonce.Provideafauxcompareimmediately
afterthecalltoGetAuthorization().
Dontdoacomparisonwithasinglecompare.Instead,performsome
mathematicaloperationsontheresult,computinganotherresultthatis
verifiedlaterinthecode.
Forplatformsthatpermitselfmodifyingcodeandwheretheactual
challengealgorithmsareincludedinthecode,hidethechallenge
algorithmsbyencryptingthecode.Decryptonlylongenoughtoverifya
challengeandthenreencryptit.Checksumthecodethatcallsthe
1 3 0 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
encrypt/decryptroutinestopreventalteration.Havetheentrypointin
thelicensemoduleverifythecodeoffset(ifapplicable)fromwhichit
wascalled.Encryptingthealgorithmsmakesthemmoredifficultto
locateinthecode.Also,encrypttheMasterKeyandtheUserKey.
Ifthehostoperatingsystempermits,placemostoftheauthorization
codeanddataintooverlaysthatcanbediscarded.
CallGetAuthorization()periodically(i.e.,every15minutes).
Thesearejustafewpossibilitiestoconsider.Thinkaboutantivirustechniques
andthemeasurestakentopreventcodemodification.Thosesameanti
tamperingtechniquesareapplicablehere.
AlwayscallInitCrypkey()andGetAuthorization()beforeanyotherCrypKey
functions.
AlwayscheckthereturnonInitCrypkey()anddonotlettheprogramrunifthe
returnislessthanzero.
EnsureEndCrypkey()iscallednomatterhowyourprogramisexited.Itisa
commonmistaketocallonlyEndCrypkey()inyourFile/Exitmenuroutine.If
theuserexitsbydoubleclickingthetitlebar,theEndCrypkey()functionis
skipped,whichcausesproblems.
1 3 1 C RY P K E Y S D K
U S E R M A N U A L
Network Licensing
CrypKeyallowsyoutocontrolthelicensesyouissue, Section
8
evenwhenyoursoftwareisdistributedacrossa
network.Ifmoreclientsrequestaccesstoyoursoftware
thanyouhaveallowed,CrypKeyprovidesaccessona
firstcome,firstservedbasis.
oucancontrolthenumberofusersandcomputersthatuseyoursoftware
Y
concurrentlyfromanetworkedserver.Youcantransferyourlicensesfrom
machinetomachineacrossanetwork.
Iftherearemorerequestsforaccesstoyoursoftwarethanyouhaveallowed,
CrypKeyqueuestherequests.Forexample,ifyouissueakeywiththeSiteKey
Generatorthatallowsfourfloatinglicenses,yourcustomercanrunyour
programonanyfourclientsinhisorhernetwork.Ifafifthclientattemptsto
startyourprogram,heorsheistoldtowaituntilsomeoneelsecurrently
runningtheprogramclosesit.Ifmoreusersattempttostartyourprogram,they
areplacedinafirstcome,firstservedqueue.Theclientseachgettheirturnin
theordertheiraccessattemptwasmade.
1 3 3 C RY P K E Y S D K
U S E R M A N U A L
usingtheprogram.IfCrypKeysuspectsthatauserisnotusingtheprogram
(perhapsthemachinehascrashedorthenetworkconnectionhasfailed)it
takesthelicense,aftertheperiodofthenetwork_max_checktimeisexceeded,
andgivesittoauserwhohasrequestedaccess.Thisensuresthatthelicenses
arenotpermanentlyheldwhentheusersarenotusingtheprogram.
TherecommendedintervalbetweencallstoGetAuthorization()is5to30
minutes,dependingonyourapplication.Thenetwork_max_checktime
parameter,locatedintheInitCrypkey()function,isthemaximumtime(in
seconds)thatCrypKeyshouldwaitbeforereleasingalicensethatisnolonger
accessed.Network_max_checktimeshouldbetwoorthreetimestheexpected
intervalbetweencalls.
TheFloatingLicenseSnapshot()functionprovidesasnapshotofallusers
holdingorwaitingforanetworkfloatinglicense.
Normally,usersreadyourprogramfromaclientcomputerthatisconnectedto
theserverviaanetwork.Youmustinstalltheappropriatenetworkdriveronthe
networkserverthatcontainsthelicensefileforyourprotectedprogram.Once
thedriverisrunning,CrypKeyoperatesontheserverfromanyothercomputer,
justasiftheserverwerealocaldrive.Formoreinformationoninstalling
networkdrivers,seetheinstallationinstructionsinSections2.2to2.5.
1 3 4 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Note:TheNTdriverisrequiredforstandaloneand/ornetworklicensingon
allNTplatforms,includingXP,Win2000,andNT.Allotherdriversinthe
/NETDRIVEdirectoryarerequiredonlyfornetworklicensing.
CrypKeyusesanencryptedfilerequest/responsemodeltohandlenetwork
authorizations.Thisinnovativeapproachhasmajoradvantages:
YourapplicationusesthesameCrypKeylibraryforallnetwork
platforms.Nochangestoyourapplicationarerequiredfordifferent
networks.
Sinceyourapplicationusesonlyonelibraryforallnetworks,thereisa
significantsavingstoyouincodesizeandcomplexity.
Yourprogramworksonanynetworkthatdoesfiletransfers.
setupex.exe andcks.exe:Thesedriverfilesarerequiredtorunan
applicationonWindowsNT(includingWindowsNT/2000/XP)
standaloneorservermachines.
Note:youmustalwaysusethisdriverforbothstandaloneand
networkinstallationwhenrunningNTplatforms.
ckserver.nlm:ThisisaNovellNetWareLoadableModulethatworks
forNetWare3.x,4.x,5.x,and6.x.Ckserver.nlmdoesnotrequireany
configuration.Novellsupportsonlynetworkuse.
wckserve.exe:ThisisaWindowsprogramthatrunsonanyWindows
3.x,Windows95,Windows98,orWindowsMEserver.Itisunlikelythat
youneedtosupportthisplatformasaserver.
1 3 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
ckserver.exe:ThisdriverisintendedforanMSDOSserver.Itisa
terminateandstayresident(TSR)programandcannotberunona
Windowsserver.Itishighlyunlikelythatyouneedtosupportthis
platformasaserver.
OS2:Thisdriverisincludedforlegacysupport.
Allserverdriversrequiretheclienttohavereadandwriteaccesstotheshared
directory.ForNetWareservers,theclientmusthaveread,write,filescan,
modify,anddeletepermissions.
ThisdriverisrequiredforstandaloneornetworklicensinguseonNTPlatforms.
Note:ThisisthemostimportantdriveroftheCrypKeysystem.Itisthe
CrypkeyLicenseServicerequiredonNT/2000/XPsystems.
Procedure
1. Copythefilessetupex.exeandcks.exetotheapplicationdirectory.
Note:Yourequireadministratorprivilegestoinstallthelicenseservice.
2. Runsetupex.exe.
setupexe.exeextractsandinstallsthefollowingfilesfromcks.exe:
WINNT/System32directory:ckldrv.sys,crypserv.exe
WINNTdirectory:ckrfresh.exe,setup_ck.dll,setup_ck.exe
Note:InWindowsXP,thesefilesgointotheWindowsandSystem
directories.
Tomeasurethesuccessoftheinstallation,afileiscreatedintheapplication
directorycalledsetupex.xco.Itcontainsonlythevalue0iftheinstallationis
successful.
C RY P K E Y S D K 1 3 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Seethereadme.txtin~\CRYPKEY.60\NETDRIVE\NTDRIVERfordetailsthat
havebeendocumentedafterpublicationofthismanual.
Procedure
1. CopyCKSERVER.NLMtotheSystemdirectory.
2. IntheNovellAUTOEXECfile,insertthefollowingstatement:
LOAD CKSERVER
Thisstartsthedriveruponreboot.
3. Tostartthedrivermanually,ontheNovellserverinmonitormode,type
LOAD CKSERVER
Note:Novell'sPatchLevel#5forNovell3.x.istheminimumpatchlevel
requiredtorunCKSERVER.NLMon3.x.Thisisavailablefromusbyrequest.
ThisisaWindowsprogramthatrunsinvisiblyinthebackground.Youmust
provideitthepathwhereyourCrypKeyprotectedapplicationresides.
Directoriesmustbedefinedinthecommandlineorbysettingtheenvironment
variableCKSERVE.(Thisisnotamisprinttheenvironmentvariableis
CKSERVE.)
Example1commandline
WCKSERVE.EXEC:\APP1;C:\UTIL\APP2;E:\WIN\APP3;
Example1autoexec.bat
SETCKSERVE=C:\APP1;C:\UTIL\APP2;E:\WIN\APP3;
Toinstallthisonyourcustomersmachine,ensureitisrestartedeachtimethe
machineisrebootedbyreferencingthisintheWindowsStartUpfolder.
1 3 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
DOS CKSERVE.EXE
ThisisaDOSTSRthatrunsinvisiblyinthebackground.Youmustprovideit
withthepathtothedirectorywhereyourCrypKeyprotectedapplication
resides.Directoriesmustbedefinedonthecommandlineorbysettingthe
environmentvariableCKSERVE.
Example1commandline
CKSERVE.EXEC:\APP1;C:\UTIL\APP2;E:\WIN\APP3;
Example1autoexec.bat
SETCKSERVE=C:\APP1;C:\UTIL\APP2;E:\WIN\APP3;
Toinstallthisonyourcustomersmachine,ensureitisrestartedeachtimethe
machineisrebootedbyreferencingthisintheAUTOEXEC.BAT.
OS2 Driver
WindowsCrypKeyprotectedprogramscanberunonanOS2machineand
networkedfromanOS2machineusingtheOS2driver.
CKSVROS2.EXEOS2drivernativeOS2program
CKSVROS2.HLPOS2driverhelpfile(OS2,notWindows,helpfile)
CKOS2WIN.HLPOS2driverWindowshelpfile
C RY P K E Y S D K 1 3 8
U S E R M A N U A L
Moving Protected Programs
Thelicensetransfersystemisanoptionalfeaturethat Section
9
allowsyourclientstotransfertheirlicensesfromone
computerordirectorytoanotherwithoutcontacting
you.
I fmultiplecopyfixedlicensesareissued,werecommendusingthelicense
transferfeaturetoallowyourcustomertodistributethemultiplecopiesto
differentsites.
TherearetwomethodsformovingaCrypKeylicense:
Direct Transfer:Usedtomovealicensefromonelocalornetworked
directorytoanother.
Floppy Transfer:Usedtomovealicensefromonecomputerto
anotherwhenthetwocomputersarenotnetworkedortheCrypKey
networkdriverisnotpresent.Inthiscase,themoveisdoneusinga
floppydisk.
Thesetwomethodsdonotactuallycopytheprogramfromonedirectoryto
another.Instead,theymovethelicensefromoneprogramtoacopyofthesame
programinadifferentdirectory.Theusermustthereforecopytheprogramto
thetargetdirectoryorcomputerbeforeusingthelicensetransferfunction.
Thefunctionsimplytransfersonelicensefromthesourcedirectorytothetarget
directory.Thetargetdirectorymustbelocal(i.e.,onadrivelocatedinthesame
computer)tothesourcedirectoryorthedirectoriesmustbeconnectedbya
networkandhaveaCrypKeynetworkdriverservicingeachofthem.
1 3 9 C RY P K E Y S D K
U S E R M A N U A L
9.1.1 Example
IfyouhaveaprogramwithonevalidfixedlicenseinC:\Tempandyouwantto
moveittoC:\Apps\Bingo:
1. CopyyourprogramtoC:\Apps\Bingo.
2. RuntheprogramthatisinC:\Temp.CallDirectTransfer()andprovide
itthepathnameofC:\Apps\Bingo.Instantly,thecopyin
C:\Apps\BingohasavalidlicenseandthecopyinC:\Tempdoesnot.
Totransferalicensefromonecomputertoanother,youmusthaveacopyof
theprograminstalledandauthorizedononecomputerandacopyofthe
programinstalledbutnotauthorizedonanother.Assumingthatthetransferis
fromanalreadylicensedsourcecomputertoanunlicensedtargetcomputer
viafloppydisk:
1. Starttheprograminthetargetcomputerandregisterthetransferby
tellingtheprogramtocalltheRegisterTransfer()function.Theuser
mustsupplythepathtothefloppydisk.Thisfunctionputsaregistration
imprintfileonthefloppydisk.Takeoutthefloppydiskfromthetarget
computerandplaceitinthesourcecomputer.
2. Starttheprogramonthesourcecomputerandtellittocallthe
TransferOut()function.Theusermustsupplythepathtothefloppy
disk.Thisfunctionreadstheregistrationimprintfileandwritesa
matchinglicenseimprintfiletothefloppy.Italsodiscontinuesthe
licenseatthesourceifithadonecopyoritdecrementsthelicenseatthe
sourcebyoneifithadmultiplecopies.Takeoutthefloppydiskfromthe
sourcecomputerandreturnittothetargetcomputer.
3. Restarttheprograminthetargetcomputerandtelltheprogramtocall
theTransferIn()function.Theusermustsupplythepathtothefloppy
disk.Thiscompletesthetransferanddiscardstheintermediateimprint
files.
1 4 0 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Ifyouwantyourprogramtobeabletotransferitslicenseviafloppydisk,you
mustprogramyourapplicationtoallowtheusertoinitiatethefollowing
functions:
RegisterTransfer()
TransferOut()
TransferIn()
1 4 1 C RY P K E Y S D K
U S E R M A N U A L
Frequently Asked Questions
Thefollowingquestionsarefrequentlyaskedofour Section
1
technicalsupportrepresentatives.
0
uccessfullyansweringyourquestionsisapriorityoftheCrypKeySDK
technicalsupportteam.SinceCrypKeysinceptionin1992,wevestrivento
eliminateyourguesswork.Weencourageyoutoreadthroughthe
followingpagesbeforecontactingusforsupport.
10.1 General
A Yes.Intodayshightechworld,youneedcopyprotection.Acopyrightsign
onyourproductdoesnotguaranteethatuserswillnotcopyyourproduct.
Copyrightlaws,likeallothers,canbebrokendespiteenforcementefforts.If
youreconsideringmarketingoverseas,thesituationisevenmoreserious.
ManycountriesoutsideNorthAmericaarewithoutanyformofcopyright
law,furtherincreasingthepossibilityforunpaidcopiesofyourproductto
enterthemarket.
AlthoughsoftwaregiantssuchasMicrosoftcanabsorbsalelossesrelatedto
illegalcopying,smallerplayers,whosemarketismoredefinedandvertical,
cannot.Softwareisnolongersolelyproducedbylargesoftwarehousesand
soldinmassquantities.Todayssoftwaredevelopersincludedoctors,
lawyers,engineers,andthoseinyourprofession:essentiallyanyindividual
withknowledgethatcanbesharedandmarketedthroughthemediumof
computers.
1 4 3 C RY P K E Y S D K
U S E R M A N U A L
10.1.2 CrypKey Advantages
Q WhyisCrypKeytheprotectionpackageofchoice?
A TheCrypKeylicensingsystemcircumventstheproblemsprevalentin
currentsoftwareprotectiontechnology,asoutlinedbelow:
1 4 4 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 4 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
A TelephoneauthorizationreplaceskeysintheCrypKeysystem.Theprocess
isasfollows:
onceinstalledonyourclientscomputer,yourproductgeneratesa
sitecodespecifictothatcomputer,whichyourclientsendsyouby
telephone,email,orfax
usingCrypKey,yougenerateanauthorizationcode(forimmediate
orlaterdistributiontoyourclient)thatallowsyourproducttorun
onlyonthecomputerthatgeneratedthesitecode
C RY P K E Y S D K 1 4 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
A CrypKeyusershaveadvisedusthatthisdrawbackistypicallyperceived
ratherthanactual,mitigatedbyclientreliefovertheabsenceofhardwareor
diskkeys.However,waystocapitalizeontheCrypKeytelephone,email,or
faxauthorizationsysteminclude:
Shipyourproducttopotentialclientsindemonstrationform.When
yourclientsarereadytobuy,usetheauthorizationinteractionto
answerquestionsandgetcustomerfeedback.
Sendyourclientsadiskthatdemonstratesyourproductsoptions.
Askclientstocallwhentheyhavedeterminedwhichoptionsthey
want.WithCrypKey,youcanturnonthedesiredoptionsduringthe
call,andclientsoftenpurchasemoreoptionsthanoriginally
ordered.
Ensureyourclientiscomfortableandsatisfiedwithrunningyour
product.Clientsappreciatesupportandyoumaypreventproblems
andillwillfromoccurring.
A No.CrypKeystriallicensingfeatureensuresthatclientscancontactyoufor
permanentauthorizationduringregularbusinesshoursandcanopenand
useyourproductanytimetheychoose,includingweekendsandholidays.
CrypKeyallowsyoutoexpeditetherepairormodificationoflicenses.
CrypKeydramaticallyreducesyourcustomersupporthours.
A Computersignaturesarederivedfromunchangeableparametersparticular
tothemachinessoftwareinstallation,whicharenearlyimpossibleto
duplicateonanothermachine.
1 4 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
A Althoughthedecisiontoallowfloppydisklicensetransfersisyoursalone,
notethatatransferincorporatesthefollowingprocess:
1. Thesignatureofthetargetcomputeriswrittenonthefloppy(in
highlyencryptedfiles).
2. Thelicenseistransferredfromthesourcecomputertothefloppy.
3. Thelicenseistransferredfromthefloppytothetargetcomputer.
EvenifthefloppyiscopiedafterStep2,itonlyworksinthespecifictarget
computerbecauseofinformationencodedinStep1.
Q Whatifthetransfertothefloppyiscorrupted?Doesthatmeanthelicenseis
deletedfromthesourcemachine,butisunreadablefromthefloppy?
A Yes.Werecommendthatcustomersminimizethenumberoftimesthe
transferisdone,andtakeprecautionswiththeirmedia.Thereislittle
chanceofthishappeningwithDirectTransfer,sincetheprocessincludes
manysafetytests.
10.2 Technical
A CrypKeyisgenerallyimmunetotheseprograms.WithSpeedDisk,however,
adheretoinstructionsinNortonUtilitiesSpeedDisk,page62,toensure
CrypKeylicensingfilesremainundamaged(seeSection11.5:Norton
UtilitiesSpeedDiskformoreinformation).
C RY P K E Y S D K 1 4 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
A Yes.CrypKeysupportstheWatcomdevelopmentenvironmentviaour16
and32bitDLLsalongwithMSDOSprogramswithexternallinking
capabilities.
A No.CrypKeyishighlynonintrusive,meaningthatitworkswithvirtually
anysoftware,andmoreimportantly,anyhardware.
A Weprovideanewlicense,noquestionsasked.Ourclientsalwaysreceive
thebenefitofthedoubt.
Inreality,harddiskfailuresamongCrypKeyclientsarerare.CrypKeys
threeyearrelationshipwithFlowel,apopularflowcalculationprogramwe
marketworldwide,hasresultedineightreportedharddiskcrashes,of
whichwefeelonlytwoaresuspect.
A CrypKeysimplifiesreleasingyourproductupdates.Copythenewversionof
theproductovertheoldoneanditassumestheexistinglicense.
1 4 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
A Yes.Tosuccessfullyawardaproductmultiplenames,ensureallnameskey
offonefileguaranteedtooccupythesamedirectoryasyourproduct.
CrypKeyallowsyoutoselectthefileyouwantthelicensebasedon.
Forexample,allversionsofProduct1keyoffafilenamedproduct1.dat,
locatedinthesamedirectoryasthe.exeforeveryinstallationofyour
product.ThismethodmakesiteasytoconsistentlyinstallCrypKeyinall
yourproductversions.
A CrypKeysmechanismforcountinglicensenumbersisfoolproof.Ifa
particularapplicationofyourproductfailstocallGetAuthorization()
regularly,itlosesitslicense.ParametersoftheInitCrypkey()callcontrol
thetimebeforetheapplicationfails.Changetheseparameterstosuityour
requirementstopreventunauthorizeduseofyourproduct.
A No.CrypKeyrecordseachtimeclientschecktheirlicensestatusfromwithin
yourproduct.Ifclientssetbacktheirclocksmorethan75minutes,CrypKey
generatesanerrorcodeforyourproduct.
Thereareprogramsavailableonthemarketdesignedtotrytodeceivetime
restrictedsoftwareprotectionsystems.Theseprogramsautomatethe
processofchangingacomputer'sclockinordertobypasstimerestricted
protection.Theseprogramschangethetimeregisteredbytheprotected
program.Forexample,iftheregisteredtimeneverextendsbeyondyour
program'strialperiod,ausercanintheoryrunyourprogramindefinitely.
CrypKeysafeguardsagainstclockmanipulationsbymonitoringyour
customers'computersfortheinconsistenciesgeneratedbysuchanattack.
CrypKeydetectswhentimeisfalselyreportedtoyourprogram,and
C RY P K E Y S D K 1 5 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
preventsyourprogramfromrunning.TimesreportedbyCrypKeyarethat
oftheserver,adjustedtothelocaltimezoneofthecomputer.
CrypKeymayalsodetectclockmanipulationifusersadjusttheircomputer
clockbymorethanseveralhours,evenforbenignpurposessuchastesting.
Ifyourprogramispreventedfromrunninginthesesituations,your
customercancorrectthesituationbyrebootinghisorhercomputer.
A Yes.CrypKeycanbeusedifyouinstalltheexecutabletoyourharddrive
fromaCDROMoritremainsresidentontheCDROM.
Inthelattercase,theproblemthatarisesconcernstheinabilityofCrypKey
towriteitslicensefiles,whicharecreateddynamically,tothereadonlyCD
ROM.CircumventthisissuebystoringCrypKeylicensefilesonyourhard
drive.CrypKeystoreslicensefileswhereyouspecify.
Inanetworklicensesituation,ratherthandownloadingalargeprogram
acrossthenetworkwhenitruns,installtheprogramonthetargetmachine
andensureonlythelicenseresidesontheserver.
A Yes.BecauseCrypKeyeliminateshardwareordiskkeytechnology,it
providesanidealchannelforinternetdistribution.
A Yes.UseCrypKeytoprotectanunlimitednumberofprogramsrelatedto
yourproduct.Theoptionsfeatureindividuallyenablesordisablesupto32
programsperproductatnoadditionalcost.
1 5 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Youcansetupsubmodulestocheckthemainmoduleslicensefile.You
achievethisbypassingthemainmodulepathtotheInitCrypkey()callin
allmodules.AllmodulesmustalsousethemainmodulesMasterandUser
Keys.
A Yes.CrypKeyisfullyfunctionalontheJapaneseNECPCandtheKanji
versionofWindows95.OtherAsianandEuropeanversionsofWindowsare
alsosupported.
A Yes.CrypKeyfullysupportsIomegaZipandJazdrives.CrypKeyprotected
productscanbenormallyinstalledandrunfromthesedrives.Other
removableharddrives,however,arenotsupportedandCrypKeyprotected
softwaredoesnotrunfromthem.
A No.CrypKeydoesnotconflictwithanyantivirussoftware.
A Yes.CrypKeyisfullycompatiblewithallinstallersystems,especially
InstallShield3.WeuseInstallShield3inourownsoftwareandhavenever
experiencedproblems.
C RY P K E Y S D K 1 5 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
10.2.16 US Exports
Q CanIexportmyCrypKeyprotectedproductfromtheUnitedStates?
A Yes.CrypKeycomplieswithU.SDepartmentofCommercerulesforexport
toallcountriesexceptCubaandSyria.
A No.CrypKeysupportsallelementsrequiredtoallowyourproducttoquality
forMicrosoftsDesignedforWindowscertification.
10.2.18 Windows 98
Q DoesCrypKeyworkonWindows98?
A Yes.CrypKeyandCrypKeyprotectedproductsrununderWindows98.
Note,however,thatifyouareconvertingfromFAT16toFAT32,youmust
firsttransferyourlicensetoanothercomputertoretainyourauthorization.
1 5 3 C RY P K E Y S D K
U S E R M A N U A L
Troubleshooting
Havingtrouble?Thissectionprovidessolutionsto Section
1
somecommonproblems.
1
inceimplementingCrypKeySDKcancreateproblemsinsome
S environments,youshouldcheckyourenvironmenttypeagainstthelisted
typestopinpointproblemsandidentifysolutions.
ThischapterincludesthemostcommonproblemsreportedtoCrypKeys
technicalsupportteam.Forproblemsnotlistedhere,pleasevisitourwebsiteat
www.crypkey.comandreviewoursearchablesupportdatabase.Thedatabase
isaccessibleusingacustomerpasswordthatyoucanobtainfromus.
Generalerrorcodesareintheranges100to199,and200to299.General
errorsincludenetworkandDLLcommunicationerrors.Youshouldalways
checkforthesereturnvaluesandgivesomeexplanationtothecustomerifthey
occur.ExplainErr()(Sec.12.3.8)returnsanappropriatemessage.
Note:errorsinthe200to299rangeresultfromsecuritychecks.Themost
commoncauseoftheseerrorsistheplacementofthe.ngnfileinadifferent
directorythantheonetheexecutableresidesin.Inthesecases,movingthe
.ngnorexecutabletotheproperlocationshouldcleartheerror.Ifitdoes
not,pleasecontactCrypKeytechnicalsupport.
1 5 5 C RY P K E Y S D K
U S E R M A N U A L
ThemostcommonCrypKeyerrorisError102withthemessage
NETWORK_NO_CKSERVE.SeeSec.11.2foradetaileddiscussionofthiserror.
Ifyouencounterthiserror,sendanemailmessagecontainingthedateof
setupex.exetoCrypKeytechnicalsupportatsupport@crypkey.com.
1 5 6 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
INITIALIZATIONFAILURE
NETWORK:NETWORKDRIVERAPPEARSNOTTOBESERVINGIN
DIRECTORY/102
ProblemsofthistypeusuallyoccuronNTorNovellNetwarefilesystemswhere
thedirectorysecurityismodified.Refertothefollowingtroubleshootingcharts
forassistancewiththisproblem.
1 5 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 5 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 5 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 6 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
.cknfilethisisafilecreatedbytheCrypKeyfunctionsandcontainsuseful
informationthatmaybevaluableforresolvingyourproblem.Thefile
residesinyourCrypKeydirectories.Whenopened,the.ckninformation
appearsinawindowsimilartothefollowing:
theCrypKeylibrariesused
yourcompilerandversion
1 6 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 6 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
3. Restarttheapplication.
2. Specifythatthe*.ent,*.rst,and.key,filescannotbemoved(the.41sfiles
neednotbespecified).
1 6 3 C RY P K E Y S D K
U S E R M A N U A L
Function Reference
WhenusingsomeofCrypKeyfunctions,youllneed Section
1
backgroundinformationandtechnicaldetails.
2
hissectioncontainsreferenceinformationthatsupportstheother
T sectionsinthismanual.Itdescribesthefunctionsandgeneralerrorvalues
usedbyCrypKeyandprovidesassistanceforprogrammingyourCrypKey
code.Forfunctiondeclarations,refertothesamplecode.
1 6 5 C RY P K E Y S D K
U S E R M A N U A L
Name Function
CrypkeyVersion() Returns the version number of the CrypKey library
currently in use. The function name in Visual Basic
is crypkeyVersion.
DirectTransfer() Called from an application that has authorization,
this function transfers the applications
authorization license to another directory.
EndCrypkey() Notifies CrypKey that the program is terminating.
ExplainErr() Returns a text string that explains the return code
of various functions.
ExplainErr2() Returns a text string (written into string text) that
explains the return code of various functions.
FloatingLicenseGetR C#.NET function only: returns a single record of
ecord() the current floating license status. The function
FloatingLicenseTakeSnapshot() needs to be
called before this function.
FloatingLicenseSnap Returns a snapshot of all users holding or waiting
shot() for a network-floating license.
FloatingLicenseTake C#.NET function only: returns a snapshot of all
Snapshot() users holding or waiting for a network floating
license.
Get1RestInfo() Returns authorization options, the number
allowed, and the number used.
GetAuthorization() Gets the level at which the program is authorized
to run or an authorization failure code. Also used
to decrement the number of uses count.
GetAuthorization2() The same as GetAuthorization(), except this
function decrements the number of uses count
only.
GetDrivePermanentS Proprietary CrypKey software function that
erialData() accesses the following hard drive information on a
customers computer: model number, serial
number, firmware data.
GetLastError() Returns the text for the last error reported.
GetLastErrorCode() C#.NET function only: returns the number of the
last error reported. Used when you use some of
the safe code alternative functions in C#.NET.
GetLevel() Returns the level of authorization or -1 if the
program is not authorized.
1 6 6 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Name Function
GetNetHandle() Gets the network license handle of the protected
program.
GetNumCopies() Gets the number of license copies that the current
site has been granted.
GetNumMultiUsers() Gets the number of customers to whom the site
license has been granted.
GetOption() For a specific option, the function returns 1 if the
option is on, 0 if the option is off, and -1 if the
program is not authorized.
GetRestrictionInfo() Gets information on any restrictions that are
present in the license.
GetSiteCode() Gets the site code for the program installation
location (site).
GetSiteCode2() Returns a pointer to the site code. The same as
GetSiteCode(), except text is not written to a
string.
InitCrypkey() Initializes CrypKey with the required runtime
information.
KillLicense() Kills the protected program's license and provides
a confirmation code.
ReadyToTry() Sets up a days class, one-time automatic license
without version control. The function name is
readyToTry in Visual Basic.
ReadyToTryDays() Sets up a days class, one-time automatic license.
The function name is readyToTryDays in Visual
Basic.
ReadyToTryRuns() Sets up a runs class, one-time automatic license.
The function name is readyToTryRuns in Visual
Basic.
RegisterTransfer() Called from an application that does not have
authorization, this function registers the
application by placing special files on a disk or
directory.
SaveSiteKey() Used to save the site key that is acquired by the
customer. The key is checked before it is saved.
1 6 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Name Function
SetNetHandle() Sets the network license handle reference of the
protected program.
TransferIn() Called from an application that does not have
authorization, this imports an authorization license
by reading special files from a disk or in a directory
that were created by the TransferOut() function.
TransferOut() Called from an application that has authorization,
this exports the applications authorization license
by writing special files out to a directory where a
registration file was created using the
RegisterTransfer() function. Only the registered
application can successfully call the TransferIn()
function to import this license.
Note:asmentionedinthetablebelow,errorsinthe200to299range
resultfromsecuritychecks.Themostcommoncauseoftheseerrorsisthe
placementofthe.ngnfileinadifferentdirectoryfromtheonewherethe
executableresides.Inthesecases,movingthe.ngnorexecutabletothe
properlocationshouldcleartheerror.Ifitdoesnot,pleasecontactCrypKey
technicalsupport.
C RY P K E Y S D K 1 6 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 6 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 7 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 7 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
YoucanalsoseeasummaryofthesefunctionsinSec.12.1:FunctionSummary,
andinAppendixIIQuickReference(Sec.14.1:CrypKeyFunctions).
Whereapplicable,eachdescriptionincludesaprototypestable,showingthe
following:
Cprototype,forusewiththeCrypKeyLibrary
C++prototype,forusewiththeCrypKeyCOMobject
VisualBasic(VB)prototype,forusewiththeCrypKeyCOMobject
C#.NETprototype,forusewiththeCrypKey.NETassembly
NotethatsomeoftheC#.NETmethodsareunsafecodebecausetheypass
valuesbyreference.Thesefunctionsareprovidedforcompatibilityonly.
Alternatemethodsexistthatcontainsafecodeandareinmanycasesprovided
inthisdocument.
12.3.1 AcquireLicense()
AcquireLicense()isanewfunctionthatallowsanunlicensedCrypKey
protectedprogramtoacquirealicensefromalicensedcopy.Itistheopposite
oftheDirectTransfer()function.
Forthisfunctiontobesuccessful,certainconditionsmustbemet:
thetargetdirectorymustnotalreadyhaveavalidlicense
thesourcemusthaveatleastonevalidlicense
ifeithersourceortargetdirectoryisnotlocal,aCrypKeydrivermustbe
operationonthemachinethedirectoryison
Ifthesourcelicenseisafixedlicenseandhasmorethanonecopy,thisfunction
transfersexactlyonecopytothetargetanddecrementthesourcenumberof
copiesbyone.
C RY P K E Y S D K 1 7 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Ifthesourcelicenseisafloatinglicensewithxusersallowed,theentirelicense
includingxusersistransferred.
Note:ifthesourcedirectoryisnotlocal,thesourcelicensedoesnothavetobea
floatinglicensetobetransferred.
Usage
1. Acompanycandistributefixedlicensestoanumberofclientcomputersby
havingtheclientacquirethelicensefromaserverblessedwithmultiple
fixedlicenses.
2. AnewversionofCrypKeyprotectedsoftwarecanautomaticallyacquireits
licensefromtheoldversion.
Prototypes
Language Syntax
C int AcquireLicense (char *licensePath);
Parameter
ThelicensepathisapointertoaNULLterminatedstringthatgivesthe
directoryfromwhichthelicenseistobeacquired.Forsuccessfuloperationof
thefunction,thedirectorymustcontainavalidlicenseforthecallingprogram.
Return Value
Ifthefunctionoperatesnormally,itreturnsthevalue0.Otherwise,itreturns
oneoftheerrorvaluesdescribedinthetablebelow.
1 7 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 7 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.2 CKChallenge()
Note:itisrecommendedthat,insteadofthisfunction,32bitprogramsuse
CKChallenge32()seeSec.12.3.3.
CKChallenge()verifiesthattheCrypKeyDLLhasnotbeenreplacedwithan
impostorDLL(itisalsoverifiestheauthenticityoftheCrypKeyexternal
program.Inordertousethisfunction,youmusthavethecompanyand
passwordnumbersthatCrypKeygaveyouwhenyoureceivedyourMasterKey
andUserKey.
Ifyoudoacalculationwiththeseandtwootherrandomlychosennumbersand
thencalltheDLLtodothesamecalculationwiththesamefournumbers,the
DLLshouldarriveatthesameanswer.OnlytherealDLLcandecodetheMaster
KeyandUserKeytogetyourcompanyandpasswordnumbersforthe
calculation,soanimpostorDLLhasgreatdifficultyprovidingthecorrect
answerforanypossiblevaluesofthetworandomnumbers.
1 7 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Usage
CallCKChallenge()whentheprogramfirststartstoensuretheauthenticityof
theDLL(ortheexternalprogramifyouareusingexternallinking).Youcanalso
callthisfunctionperiodicallytocheckthatthelicenseisvalidinsteadof(orin
additionto)usingGetAuthorization().Ifthelicenseisnotvalid,CKChallenge()
doesnotreturnthecorrectcodes.
Prototypes
Language Syntax
Parameters
Random1
Random1isa16bitnumberchosenatrandom.Agoodwaytogetarandom
numberistousethesystemtime.Thisnumbermustbelessthan32,768.
Random2
Random2isa16bitnumberchosenatrandom.Agoodwaytogetarandom
numberistousethesystemtime.Thisnumbermustbelessthan32,768.
Return Value
CKChallenge()returnstheresultofthechallengecalculationdoneusingthe
twoparametersofthisfunction.Theactualcalculationthatthefunctionreturns
is:
initializeresultto0
repeat11times:
C RY P K E Y S D K 1 7 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
TheactualcalculationthatyouwoulddoinCcodeisasfollows:
Notes
TheInitCrypkey()andGetAuthorization()functionsmusthavebeencalled
andreturnedsuccessfullyforCKChallenge()towork.NotethatCKChallenge()
doesnotreturnthecorrectcodeiftheprogramisnotauthorized.Thisgivesyou
anotherway(besidesGetAuthorization())tocheckforavalidlicense.This
functioncanonlybecalledfromapplicationsthathavetheirownMasterKey
andUserKey.CKChallenge()doesnotworkifyouareusingtheMasterKey
andUserKeyforexample.exe.
1 7 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.3 CKChallenge32()
CKChallenge32()isusedtoauthenticatetheCrypKeyDLL,ensuringthatitis
notanimpostor.ItisalsousedtoverifytheauthenticityoftheCrypKeyexternal
program.Inordertousethisfunction,youmusthavethecompanyand
passwordnumbersprovidedbyCrypKeywiththeMasterKeyandUserKey.
Ifyouperformacalculationwiththeseandtwootherrandomlychosen
numbersandthencalltheDLLtodothesamecalculationwiththesamefour
numbers,theDLLshouldarriveatthesameanswer.OnlytherealDLLcan
decodetheMasterKeyandUserKeytogetyourcompanyandpassword
numbersforthecalculation.AnimpostorDLLhasgreatdifficultyprovidingthe
correctanswerforanypossiblevaluesofthetworandomnumbers.
Usage
CallCKChallenge32()whentheprogramstartstoensuretheauthenticityofthe
DLL(ortheexternalprogramifyouareusingexternallinking).Youcanalsocall
thisfunctionperiodicallytocheckthatthelicenseisvalidinsteadof(orin
additionto)usingGetAuthorization().Ifthelicenseisnotvalid,
CKChallenge32()willnotreturnthecorrectcodes.
Prototypes
Language Syntax
Parameters
Random1
Random1isa31bitnumberchosenatrandom.Agoodwaytogetarandom
numberistousethesystemtime.Thisnumbermustbelessthan2311.
C RY P K E Y S D K 1 7 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Random2
Random2isa31bitnumberchosenatrandom.Agoodwaytogetarandom
numberistousethesystemtime.Thisnumbermustbelessthan2311.
Return Value
CKChallenge32()returnstheresultofthechallengecalculationdoneusingthe
twoparametersofthisfunction.Theactualcalculationthatthefunctionreturns
is:
{
int i;
long ret;
ret = 1;
for(i=2;i<11;i++)
{
ret = ret%32769 * ( (random1/i)%32769 + (companyNum/i)%32769);
ret = ret%32769 * ( (random2/i)%32769 + (passNumDiv2/i)%32769);
}
return(ret);
}
where:
retistheresultofthecalculation.
random1andrandom2aretwonumbersbetweenbutnotequalto0and
2311.
companyNumandpassNumareyourCrypKeyassignedsecretnumbers.
TheactualcalculationthatyouwoulddoinCcodeisalsoshowninexample.c
intheSampledirectory.
1 7 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Notes
TheInitCrypkey()andGetAuthorization()functionsmustbecalledand
returnedsuccessfullyforCKChallenge32()towork.NotethatCKChallenge32()
doesnotreturnthecorrectcodeiftheprogramisnotauthorizedthisgives
youanotherway(besidesGetAuthorization())tocheckforavalidlicense.This
functioncanonlybecalledfromapplicationsthathavetheirownMasterKey
andUserKey.
12.3.4 CKTimeString()
ThefunctionsGetAuthorization()andFloatingLicenseSnapshot()bothreturn
ULONGvaluesthatrepresenttime.Thisfunctiontranslatesthetimeintoatext
string.
Seeexample.cforanexampleofhowtousethisfunction.
Prototype
char*FUNCTYPECKTimeString(char*timestringbuf,ULONGt)
Parameters
timestringbuf
timestringbufisabuffertoputthetimestringatleast30byteswide.Thetime
stringisintheformYYMMDDHH:MM:SS.
tisthe32bitintegervaluereceivedfromtheCrypKeyfunctiontobetranslated
totext.Itreturnsapointertotimestringbufforconvenience.
12.3.5 CrypkeyVersion()
CrypkeyVersion()returnstheversionnumberoftheCrypKeysystemcurrently
inuse.
Usage
CallCrypkeyVersion()wheneveryouneedtoknowwhichversionofCrypKeyis
linkedtoyourprogramcode.
C RY P K E Y S D K 1 8 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Prototypes
Language Syntax
VB CrypKeyVersion () as Long
Return Value
CrypkeyVersion()returnsatwodigitnumberthatindicateswhichversionof
theCrypKeylibraryisinuse(33indicatesv3.3,40indicatesv4.0,43indicates
v4.3,etc.).
12.3.6 DirectTransfer()
Calledfromanapplicationthathasauthorization,DirectTransfer()transfers
theapplicationsauthorizationlicensetoanotherdirectory.Thistransfercould
befromonedirectorytoanotheronthesamecomputerorfromonenetwork
drivetoanother.
Thedirectorywherethefunctionisinitiatedmustalsobethedirectorywhere
thelicenseresides.
Note:TheInitCrypKey()andGetAuthorization()functionsmustbe
successfullycalledbeforeDirectTransfer()isused.
Usage
UseDirectTransfer()wheneveryouneedtotransferalicensefromone
locationtoanotherandthereisadirectconnectionbetweenthetwodrives.
Prototypes
Language Syntax
1 8 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Parameter
Directory
Directoryisapointertoanullterminatedtextstringthatcontainsthepathof
thedirectorytowhichtoexportthelicense.
Return Value
C RY P K E Y S D K 1 8 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 8 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
GeneralerrorvaluesalsoapplyseeSection12.2:GeneralErrorValues.
Notes
TheDirectTransfer()functionoverwritesanexistinglicenseatthetarget
locationwithoutwarning.Therefore,alwaysbecarefultocheckwhether
overwritingisdesirable.
12.3.7 EndCrypkey()
EndCrypkey()notifiesCrypKeythattheprotectedprogramisbeing
terminated.ThisallowsCrypKeytoensurethatitsstateofoperationisreleased
properlybeforehand.
Usage
EnsurethatEndCrypkey()iscalledbeforetheprotectedprogramterminates.
Forexample,ifyouarewritinginC++,agoodplacetocallthisfunctionisinthe
applicationobjectdestructor.NotethatyoumustensureEndCrypkey()is
callednomatterhowthecustomershutsdownyourprogram,evenifthe
customerdoubleclicksontheSystemmenu.
Prototypes
Language Syntax
C void EndCrypkey();
VB EndCrypKey()
C RY P K E Y S D K 1 8 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Notes
EndCrypkey()isusedonlytoupdatethestatusofamultiuserfloatinglicense.
Itisnotrequiredforanyotherpurpose;therefore,ifaprogramterminates
abnormallywithoutcallingthisfunction,therewillnotbeanyabnormaleffects
fromCrypKeywhentheprogramisrestarted.
12.3.8 ExplainErr()
ExplainErr()returnsastringexplainingthereturncodesofCrypKeyfunctions.
Note:thedatatypeCKExplainEnum(seeSec.5.4.7:COMObjectConstants)
containstheconstantvaluesforerrorshandledbyCOMObjects.Seealso
theGetLastError()function.
Usage
Itisnotmandatorythatyoushowtheseparticularexplanationstotheuser,but
itisrecommendedthatsomeexplanationbegivenwhenaCrypKeyerrordoes
occur.
Prototypes
Language Syntax
C char *ExplainErr (int functioncode, int
errcode);
1 8 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Parameters
Functioncode
Functioncodemustbeoneoftheelementsinthetablebelow.Thesecodesare
definedincrypkey.h.Functioncodedetermineswhichfunctionisexplained.
Errcode
ErrcodeisthespecificerrorcodereturnedbyoneoftheSLAPIfunctions.The
functionsarelistedinTable13.
Return Value
ExplainErr()returnstheappropriateerrormessage.
12.3.9 ExplainErr2()
ExplainErr2()returnsastringexplainingthereturncodesofvariousother
SLAPIfunctions.ThisfunctionissimilartoExplainErr(),buttheerrormessage
iswrittenintoyourstringtextinsteadofbeingreturnedasastring.
Note:thedatatypeCKExplainEnum(seeSec.5.4.7:COMObjectConstants)
containstheconstantvaluesforerrorshandledbyCOMObjects.Seealso
theGetLastError()function.
C RY P K E Y S D K 1 8 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Usage
Itisnotmandatorythatyoushowtheseparticularexplanationstotheuser,but
itisrecommendedthatsomeexplanationbegivenwhenaCrypKeyerrordoes
occur.
Prototypes
Language Syntax
C void ExplainErr2 (int func, int err, char
*text);
Parameters
Functioncode
Functioncodemustbeoneoftheelementsinthetablebelow.Thesecodesare
definedincrypkey.h.Functioncodedetermineswhichfunctionisexplained.
1 8 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Errcode
ErrcodeisthespecificerrorcodereturnedbyoneoftheSLAPIfunctions.The
functionsarelistedinTable14.
Text
Thetextparameterisapointertothebufferwheretheerrormessageiswritten.
Itmustbe80charactersinsize.
Note
ExplainErr2()isanoptionalalternativetotheExplainErr()function.
12.3.10 FloatingLicenseGetRecord
ThisfunctionisusedonlyinCOMObjectsandC#.NETAssemblies.Calledfrom
anapplicationthathasauthorization,thefunctionreturnsasinglerecordofthe
currentfloatinglicensestatus.ThefunctionFloatingLicenseTakeSnapshot(),
usedonlyinCOMObjectsandC#.NETAssemblies,mustbecalledbeforethis
function.
Prototypes
Language Syntax
C [n/a]
VB [n/a]
C RY P K E Y S D K 1 8 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Notes
ThisfunctionoperatesonlyinCOMObjectsandC#.NETAssemblies.
12.3.11 FloatingLicenseSnapshot
TheFloatingLicenseSnapshot()functiongivesasnapshotofallusersholding
orwaitingforanetworkfloatinglicense.Thefunctionfillsthebufferwith
entries,oneforeachuseraccessingthelicense.
Eachentrycontainsthecomputername,userloginname,localtimeatwhich
theuserstartedusingorwaitingforalicense,andtheusersqueuestatus(0
meanstheyhavealicense,otherwiseitisanintegerthatindicatestheorderin
whicheachentrygetsalicense).Thisisthepertinentinformationgiven;therest
isforinternaluse.
Prototypes
Language Syntax
C int FloatingLicenseSnapshot (unsigned long
bufSize, int *numEntries, FLS_REC *buf);
- or -
FloatSnapErrorEnum FloatingLicenseTakeSnapshot2
(); // safe
- plus -
int FloatingLicenseGetNumEntries (); // safe
1 8 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Parameters
Bufsize
Bufsizeisthesizeofthebufferallocatedtoreceivetheinformation.
NumEntries
NumEntriesisapointertoanintegersizedbufferthatreceivesthenumberof
entriesinthetable.
Buf
Bufisapointertoabufferofatleastbufsizebytesinsizeandreceivesoneentry
foreachuserthatiscurrentlyaccessing,orattemptingtoaccess,thelicense.
Return Value
C RY P K E Y S D K 1 9 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Notes
TheversionofthisfunctionusedinCOMObjectandC#.NETisnamed
FloatingLicenseTakeSnapshot()andisusedinconjunctionwiththeCOM
ObjectandC#.NETfunctionFloatingLicenseGetRecord().
Ascommentedintheprototypes,thefirstC#.NETcodegiven:
isunsafecode.
ThesecondC#.NETcodegiven:
issafecode.
FLS_RECisthestructureofeachinformationalentry.ItisdefinedinCrypKey.h.
ThecontentsofeachrecordaredescribedinTable16:FloatingLicense
SnapshotRecordStructure.SeealsoSec.5.4.9:ReferencingtheFloating
LicenseSnapshotRecord,whereyouwillfindtheC++andC#.NETprototypes
forfunctionsusedtoencapsulatetheFLSrecord.
1 9 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.12 Get1RestInfo()
Get1RestInfo()isusedtoreturnoneofthreedifferenttypesofrestriction
information:licensetype,numberofdaysorrunsallowed,ornumberofdays
orrunsused.Thetypeofinformationreturneddependsonthevalueofthe
whichinputparameter.
Usage
UseGet1RestInfo()wheneveryouneedtogetlicenserestrictioninformation.
Prototypes
Language Syntax
C int Get1RestInfo (int which);
Parameter
Which
Thewhichparameterissettooneofthefollowing:
1: returnsauthopt(indicatingwhetherthelicenseisunlimited,daysbased,
orrunsbased)
2: returnsnum_allowed(indicatingthenumberofdaysorrunsallowed)
3: returnsnum_used(indicatingthenumberofdaysorrunsused)
C RY P K E Y S D K 1 9 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
Note
Get1RestInfo()isanoptionalalternativetousingtheGetRestrictionInfo()
function.
12.3.13 GetAuthorization()
GetAuthorization()getsthelevelatwhichtheprotectedprogramisauthorized
torunalongwiththeoptionsenabledoranauthorizationfailurecode.Itisalso
usedtodecrementthenumberofruns,iftheapplicationisrestrictedbyruns.
Usage
GetAuthorization()canbecalledatyourdiscretiontodeterminethelevelof
authorizationthattheuserisgranted.Itcanalsobecalledtodecrementthe
numberofusestheprogramhasleftifitisrestrictedbynumberofruns.Call
thisfunctionaftercallinganyfunctionthatchangesthelicensestate,suchas
SaveSiteKey(),TransferOut()orTransferIn(),sothattheprogramcanalterits
behavioraccordingtothechangethathasoccurred.
Prototypes
Language Syntax
C int GetAuthorization (unsigned long *oplevel,
int decrement);
1 9 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Parameters
Oplevel
Oplevelisapointertoa32bitbuffer.Theoplevelisreturnedinthisvariableif
theprogramisauthorized.Itisacombinationofoptionandlevelinformation
storedin32bits.
Decrement
Ifthisnumberisnotzeroandtheprotectedprogramisrestrictedtothenumber
ofrunsallowed,thenumberofrunsremainingdecrementsbythisnumber.
Return Value
C RY P K E Y S D K 1 9 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 9 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 9 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 9 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 1 9 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
1 9 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
GeneralerrorvaluesalsoapplyseeSection12.2:GeneralErrorValues.
Notes
Theoptionsaresinglebitsofinformationthatcanbeturnedonoroff
individuallywhenalicenseiscreatedusingtheSiteKeyGenerator.Theoptions
existsothatyoucanturnonoroffdifferentfeaturesofyourproduct.The
optionsarestoredinanumericalsequencestartingatonewiththehighendbit
oftheoplevel32bitvalue.Theremainingbitsareusedtoholdthelevel
number.
ThelevelisanumberthatissetbytheSiteKeyGenerator.Itincrementally
controlsthequalityofsomeservicesyoursoftwareprovides,suchasthe
numberofrecordsallowedforadatabase.Themaximumleveldependsonthe
numberofoptionsyouhaveconfigured.
Thereare32bitsavailabletoboththeoptionandlevelvalues.Forexample,if
fouroptionsaredefinedinskw.ini,oplevellookslikethis:
C RY P K E Y S D K 2 0 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Inthisexample,themaximumlevelis228or268,435,456.
InitCrypkey()mustbecalledatleastoncebyyourapplicationbeforeusingthe
GetAuthorization()function,andthisfunctionmustbecalledatleastonce
beforeanyotherSLAPIfunctioniscalled.
TheoptionsorlevelscanalsobeobtainedbyusingGetOption()orGetLevel().
Forsecurityreasons,thisistheonlyfunction,alongwithGetAuthorization2(),
thatcantellyouifanincorrectpasswordisenteredintotheSiteKeyGenerator.
TheC#.NETprototypefortheGetAuthorization()functionisunsafecode.The
safeC#.NETalternativeisGetAuthorization2().
12.3.14 GetAuthorization2()
ThisfunctionissimilartoGetAuthorization()inthatitdeterminesifthe
programisauthorizedtorun;anddecrementsthelicensecount.However,
GetAuthorization2()doesnotobtainoptionandlevelinformation.
Usage
ThisfunctionisusedinthesamemannerasGetAuthorization()andis
intendedforlanguagesthatareunabletoobtaintheopleveldataorforcases
whereyoudonotwanttoobtaintheopleveldata.
2 0 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Prototypes
Language Syntax
C int GetAuthorization2 (int decrement);
Parameter
Decrement
Ifthedecrementnumberisnotzeroandtheprotectedprogramisrestrictedby
thenumberofrunsallowed,thenumberofrunsremainingaredecrementedby
thedecrementnumber.
Return Value
SeeGetAuthorization()foradescriptionofthereturnvaluesforthisfunction.
Notes
InitCrypkey()mustbecalledatleastoncebyyourapplicationbeforethe
GetAuthorization2()functionisused.GetAuthorization2()mustbecalledat
leastoncebeforeanyotherSLAPIfunctioniscalled.
Forsecurityreasons,thisistheonlyfunction,alongwithGetAuthorization(),
thatcantellyouifanincorrectpasswordisenteredintotheSiteKeyGenerator.
ThisfunctionisanoptionalalternativetousingtheGetAuthorization()
function.
12.3.15 GetDrivePermanentSerialData()
GetDrivePermanentSerialData()isaproprietaryCrypKeysoftwarefunction
thataccessesthefollowingharddriveinformationonacustomerscomputer:
modelnumber,serialnumber,firmwaredata.
C RY P K E Y S D K 2 0 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.16 GetLastError()
Thisfunctionreturnsthetextforthelasterror.UnliketheSDKfunctions
ExplainErr()andExplainErr2(),thefunctioncodedoesnotneedtobe
supplied.ThefunctioncodeisseteachtimeoneofthefunctionsintheCOM
objectiscalled.Thus,thisfunctionreturndonlytheerrortextforthelast
functioncalled.
Prototypes
Language Syntax
C [n/a]
VB GetLastError () as String
Notes
SeealsoGetLastErrorCode().
12.3.17 GetLastErrorCode()
Thisfunction,usedonlyinC#.NETAssemblies,returnsonlythenumberfor
thelasterror.UnliketheSDKfunctionsExplainErr()andExplainErr2(),the
functioncodedoesnotneedtobesupplied.Thefunctioncodeisseteachtime
oneofthefunctionsintheCOMobjectiscalled.Thus,thisfunctionreturns
onlytheerrornumberforthelastfunctioncalled.
Prototypes
Language Syntax
C [n/a]
C++ [n/a]
VB [n/a]
2 0 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.18 GetLevel()
Thisfunctionreturnsthelevelatwhichtheprotectedprogramisauthorizedto
run.
Usage
Youmayusethisfunctionatyourdiscretion.
Prototypes
Language Syntax
C unsigned long GetLevel (int numDefineOpts);
Parameter
NumDefineOpts
NumDefineOptsisthenumberofoptionsthattheprotectedprogramhas
defined.
Return Value
Thereturnvalueisthecurrentlevelthatisavailabletotheuserfromthe
program.
12.3.19 GetNetHandle()
TheGetNetHandle()functiongetsandreturnsthenetworklicensehandleof
theprotectedprogram.
Usage
IfyouwantseveralSLAPIlicensedprogramssharingasinglenetworkseat,you
canusethisfunctiontogetthehandleandthendistributeitusingthe
SetNetHandle()function.Thisfunctionshouldbecalledonlyaftersuccessful
callstoInitCrypkey()andGetAuthorization()havebeenmade.
C RY P K E Y S D K 2 0 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Prototypes
Language Syntax
C unsigned short GetNetHandle ();
VB GetNetHandle () as Long
Return Value
Thisfunctionreturnsthehandletoanetworkresource.
Notes
Theusermustdesignawaytotransmitthereturnvaluetootherexecutables
sharingthenetworkseat(seetheSetNetHandle()functiondescriptionin
Section12.3.33:SetNetHandle()formoreinformation.
OnlyoneoftheprogramssharingthenetworkseatcancallEndCrypkey()
successfullypreferably,thelastprogramtostopexecutingcallsthisfunction
sincethismeansthatusageofthenetworkseatisclearlynolongerrequired.
12.3.20 GetNumCopies()
GetNumCopies()obtainsthenumberofcopiesthatthesiteisgrantedunder
thecurrentlicenseprovidedtoit.
Usage
Ifyouwanttograntmultiplecopysitelicenses,theprogramshoulddisplaythe
numberofcopiesitisgrantedtotheuser.Thecopiescanbedistributedbythe
userthroughthetransferfunctions.
2 0 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Prototypes
Language Syntax
C int GetNumCopies ();
VB GetNumCopies () as Long
Return Value
12.3.21 GetNumMultiUsers()
GetNumMultiUsers()getsthenumberofusersthatthesitehasgrantedinits
license.
Usage
Ifyouwanttograntmultipleusersitelicenses,theapplicationshoulddisplay
thenumberofusersithasgrantedtotheuser.
Prototypes
Language Syntax
C int GetNumMultiUsers ();
VB GetNumMultiUsers () as Long
C RY P K E Y S D K 2 0 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
Thisfunctionreturnsthenumberofconcurrentnetworkusesgrantedinthe
license.
12.3.22 GetOption()
GetOption()determinesthestatusofaspecificoption.Thefunctiongetsthe
optionbitspecifiedinthecurrentauthorizationlicense.
Usage
Youcancallthisfunctionatyourdiscretion.
Prototypes
Language Syntax
C int GetOption (int numDefineOpts, int optnum);
Parameters
NumDefineOpts
NumDefineOptsisthenumberofoptionsthattheprotectedprogramhas.
Optnum
Optnumisthenumberoftheoptionforwhichyouwantastatus.
2 0 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
Note
Thisfunctionisasimpleralternatetoobtainingtheoptionfromthe
informationpassedbytheGetAuthorization()function.
12.3.23 GetRestrictionInfo()
GetRestrictionInfo()getsinformationonanyrestrictionsthatarepresentinthe
license.
Usage
Itisnotnecessarytotakeanyactiononthisinformation,however,youmay
wanttodisplaythisinformationatyourdiscretion.
Prototypes
Language Syntax
C int GetRestrictionInfo (int *authopt, unsigned
long *start_date, int *num_allowed, int
*num_used);
C RY P K E Y S D K 2 0 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Parameters
Authopt
Authoptissettooneofthevalueslistedinthefollowingtable(asdefinedin
crypkey.h):
Start_date
Start_dateissettothedatethelicensewasissued,insecondssincethestartof
theyear1970(UniversalCoordinatedTime).
Num_allowed
Num_allowedissettothenumberofdaysorrunsallowedbythecurrent
license.
Num_used
Num_usedissettothenumberofdaysorrunsinthecurrentlicenseusedupso
far.
Return Value
2 0 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Notes
TheGetRestrictionInfo()functionisvalidonlyiftheprotectedprogramis
authorizedtorunoriftheprogramisnotauthorizedtorunduetoexpired
restrictions(i.e.,ifthedaysorrunshaveexpired).
Thealgorithmforbreakingdownthestart_datefordisplayinCcodeisas
follows:
#include "time.h"
char* _sgtime(long ltime);
m_datetime = _sgtime(start_date);
char* _sgtime(long ltime)
{
static char time_str[60];
struct tm *t;
ltime -= 2209075200;
t = gmtime(<ime);
if(t != NULL)
{
strcpy(time_str,_ultoa(t->tm_mday,text,10));
strcat(time_str,"-");
strcat(time_str,_ultoa(t->tm_mon+1,text,10));
strcat(time_str,"-");
strcat(time_str,_ultoa(t->tm_year,text,10));
strcat(time_str," ");
strcat(time_str,_ultoa(t->tm_hour,text,10));
strcat(time_str,":");
strcat(time_str,_ultoa(t->tm_min,text,10));
strcat(time_str,":");
strcat(time_str,_ultoa(t->tm_sec,text,10));
}
else
{
C RY P K E Y S D K 2 1 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.24 GetSiteCode()
GetSiteCode()obtainsthesitecodeforthecomputeranddirectoryfromwhich
aprotectedprogramisrun.Thesitecodemustbereportedbytheuserbeforea
sitekeycanbeissuedfortheprogram.
Usage
IftheprotectedprogramdetectsitisnotauthorizedviatheGetAuthorization()
function,itmust,atminimum,showtheprogramssitecodeandallowtheuser
toenterasitekey.
Prototypes
Language Syntax
C int GetSiteCode (char *site_code);
Parameter
Site_code
Site_codemustbeacharacterbufferofatleast30bytesinsize.Thefunction
storesthesitecodeinthebuffer.
2 1 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
12.3.25 GetSiteCode2()
GetSiteCode2()returnsapointertothesitecodefortheprogramlocation.The
sitecodemustbereportedbytheuserbeforeyoucanissueasitekey.
Usage
IftheprogramdetectsitisnotauthorizedviatheGetAuthorization()function,
itmust,atminimum,showtheprogramssitecodeandallowtheusertoentera
sitekey.
C RY P K E Y S D K 2 1 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Prototypes
Language Syntax
C char *GetSiteCode2 ();
Return Value
Thisfunctionreturnsapointertothesitecode.
Note
ThisfunctionisanoptionalalternativetousingtheGetSiteCode()function.
12.3.26 InitCrypkey()
InitCrypkey()initializesCrypKeywithruntimeinformation;thisfunctionmust
becalledbeforeanyotherCrypKeyfunction.
Usage
CallInitCrypkey()attheprogramstartup.Forexample,ifyouareusingC++,a
goodplacetodothisisintheapplicationobjectconstructor.
2 1 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Prototypes
Language Syntax
C int InitCrypkey (char *filepath, char
*masterkey, char *userkey, int allow_floppy,
unsigned network_max_checktime);
Parameters
Filepath
Filepathisthepathoftheprogramfilethatischeckedforauthorization.This
filenamecanbethesamenameasyourexecutableorDLL,oryoucanchoose
touseadummyfileifyouhavemorethanoneapplicationthatyouwouldlike
toprotectwithinyourproduct;simplychooseafilenamethatisalwayspresent
inyourapplicationdirectory.Thisdummyfileneednotcontainany
information,itsimplymustresideintheapplicationdirectoryandbespecified
intheInitCrypkey()functioncall.
Masterkey
MasterkeyisthehexadecimalstringassignedtoyourprogrambyCrypKey
(Canada)Inc.atpurchasetime.
Userkey
UserkeyisthehexadecimalstringassignedtoyourpasswordbyCrypKey
(Canada)Inc.atpurchasetime.
C RY P K E Y S D K 2 1 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Allow_floppy
Setallow_floppyto1toallowauthorizationofaprogramonafloppy.Thisis
usuallysetto0,astheentirefloppycanbesuccessfullybitcopied.
Network_max_checktime
Network_max_checktimeisthetime,inseconds,thatCrypKeywaitsfora
programtocheckforauthorizationunderafloatinglicense.Afterthistime,the
userisdeletedfromthequeueofuserscurrentlyusingtheprogramorwaiting
foraccesstoit.ThisishowCrypKeyhandlesuserswhomaynothaveloggedoff
properlybyusingEndCrypkey()(perhapsbecausetheircomputercrashed).If
theuserattemptstoaccesstheprogramagain,theuserisputattheendofthe
queue,behindanyotherusersalreadyusingtheprogramorwaitingforaccess.
Thenumberyouchooseforthisparameterdependsonhowoftenyoucall
GetAuthorization(),butitalsodetermineshowfastahungcomputeris
detectedbyCrypKeyandthelicenseonthatcomputerlicensereleasedfor
otherstouse.WerecommendthatyoucallGetAuthorization()every5to30
minutes,dependingontheapplication.Thesettingfor
network_max_checktimeshouldbetwotothreetimestheGetAuthorization()
interval.
2 1 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
C RY P K E Y S D K 2 1 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 1 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 2 1 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 1 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
GeneralerrorvaluesalsoapplyseeSection12.2:GeneralErrorValues.
Note
Thefilepathparametercannotbejustthefilenameofyourprogram;itwillnot
workundersomecircumstancesunderWindows95.Youmustcarefully
providethisfunctionthefullpathsothatitcanfindyourlicense.
C RY P K E Y S D K 2 2 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.27 KillLicense()
TheKillLicense()functionisusedtodisableanexistinglicenseandprovidesa
confirmationcodethatcanbeenteredintotheSiteKeyGeneratorinorderto
displaythedetailsofthedeauthorization.
Usage
Youcanusethisfunctionwhenyouwanttoremoveanexistinglicenseand
provideyourcustomerwiththemeansofprovingthatthelicenseisdeactivated
viatheconfirmationcode.
Prototypes
Language Syntax
C int KillLicense (char *confirmCode);
- or
Parameter
ConfirmCode
ConfirmCodeisahexadecimalstringthatcanbeenteredintotheSiteKey
Generatortodisplayinformationconfirmingthatthelicenseisdeactivated.
2 2 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
Table 25: KillLicense() Values
Name Valu Message Solution
e
KL_OK 0 Function
was
performed
successfully
.
KL_CRYPKEY_NOT_INITIALIZ -1 CrypKey If this error occurs,
ED has not yet obtain the return
been code from the
initialized. InitCrypkey()
function. Something
has gone wrong in
the InitCrypkey()
function call.
InitCrypkey() must
be called before this
function.
KL_CRYPKEY_NOT_AUTHOR -2 The This error indicates
IZED protected that the application
program is for which you are
not trying to kill the
authorized license does not
have authorization
and, therefore, you
cannot kill the
license.
KL_LICENSE_WRITE_PROTE -3 The license If this error occurs,
CTED files are ensure you are able
currently to read and write
write directly to the hard
protected. drive. If you cannot
do this, you cannot
perform this
function.
Notes
TheconfirmationcodeprovidedbythisfunctioncanbeenteredintheSite
CodefieldoftheSiteKeyGenerator.Informationaboutthelicensethatwas
terminatedisdisplayedwhenthecheckbuttonispressed.
C RY P K E Y S D K 2 2 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Thisfunctiondoesnotremovethespecialharddrivesignatureofthe
automaticlicensingfunctions.
AscommentedintheC#.NETprototype,thefirstcodegiven:
isunsafecode.
ThesecondC#.NETcodegiven:
issafecode.
12.3.28 ReadyToTry()
TheReadyToTry()functionimplementsaonetimeautomaticlicensefora
CrypKeyprotectedapplication.Thislicenseisbasedonadaystimeperiod
withoutversioncontrol.
Usage
Thisfunctionneedstobecalledonlyonce,justafter
initialization/authorization.Thefirsttimeitiscalled,ittakesaminuteorsoto
setuptheautomaticlicense.Forsubsequentcallsatthesamesite,thisfunction
takesnoaction,asitdetectsthatithasalreadybeenrun.
Prototypes
Language Syntax
C int ReadyToTry (unsigned long oplevel, int
numDays);
2 2 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Parameters
Oplevel
Theoplevelparameteristhe32bitsthatcomprisethelevelandoptions.The
valuethatispassedhereisreturnedastheoplevelparameterinthe
GetAuthorization()function.
NumDays
NumDaysisthenumberofdaysforwhichyouwanttheprogramtobe
temporarilyauthorized.
C RY P K E Y S D K 2 2 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
2 2 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 2 2 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 2 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 2 2 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 2 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 2 3 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 3 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Notes
TheReadyToTry()functiondoesnotfeatureversioncontrollikeitsderivative
variantsReadyToTryDays()andReadyToTryRuns().Forprogramming
purposes,itsversionnumberparameterisalwaysconsideredtobezero.
Ifthereadytotryfeatureisused,itisagoodideatomakesurethattheuserhas
theabilitytoaccessthesitecodefromtheapplicationnomatterwhaterror
codeisreturned.Then,ifthereadytotryperiodfails,youcanalways
reauthorizeyourusersforxnumberofrunsordaysbycreatingasitekeyfor
them.
C RY P K E Y S D K 2 3 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.29 ReadyToTryDays()
TheReadyToTryDays()functionimplementsaonetimeautomaticlicensefor
aCrypKeyprotectedapplication.Thislicenseisbasedonadaystimeperiod
withversioncontrol.
Thisfunctionneedstobecalledonlyonce,justafter
initialization/authorization.Thefirsttimeitiscalled,ittakesaminuteorsoto
setuptheautomaticlicense.Forsubsequentcallsatthesamesite,thisfunction
takesnoactionunlesstheversionnumberisincremented.
Prototypes
Language Syntax
C int ReadyToTryDays (unsigned long oplevel, int
numDays, int version, int copies);
Parameters
Oplevel
Theoplevelparameteristhe32bitsthatcomprisethelevelandoptions.The
valuethatispassedhereisreturnedastheoplevelparameterinthe
GetAuthorization()function.
NumDays
NumDaysisthenumberofdaysforwhichyouwanttheprogramtobe
temporarilyauthorized.
Version
ThisnumberisusedtodistinguishoneAutomaticLicenseimplementation
fromanother,whichallowssubsequentlicensestobecreatedbynewer
versionsoftheprotectedprogram.Itcanbefrom1upto32.
2 3 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Copies
Thisisthenumberoffixedlicensecopiesthatyouwishtogranttheuserwhen
thisfunctionisrun.
Return Value
SeeSection12.3.28:ReadyToTry()foralistofreturnvalues.
Notes
Theversionparameternormallyisbegunat1andproceedsincrementally
upwardsfromthereforeachnewreleaseoftheprogram.
Inordertocreateafloatinglicensewithaspecificnumberofmultiusers,you
canenteranegativevalueinthecopiesparameter.Thisresultsinafloating
licensewithanumberofusersequaltotheabsolutevalueofthenumber
entered(e.g.,7wouldcreateafloatinglicensewith7users).
12.3.30 ReadyToTryRuns()
TheReadyToTryRuns()functionimplementsaonetimeAutomaticLicense
foraCrypKeyprotectedapplication.Thislicenseisbasedonarunsrestriction
withversioncontrol.
Usage
Thisfunctionneedstobecalledonlyonce,justafter
initialization/authorization.Thefirsttimeitiscalled,ittakesaminuteorsoto
setupthereadytotrylicense.Forsubsequentcallsatthesamesite,this
functiontakesnoactionunlesstheversionnumberisincremented.
Prototypes
Language Syntax
C int ReadyToTryRuns (unsigned long oplevel, int
numRuns, int version, int copies);
C RY P K E Y S D K 2 3 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Parameters
Oplevel
Theoplevelparameteristhe32bitsthatcomprisethelevelandoptions.The
valuethatispassedhereisreturnedastheoplevelintheGetAuthorization()
function.
NumRuns
NumRunsisthenumberofrunsyouwanttheprogramtobeauthorizedfor
temporarily.
Version
Theversionnumberisusedtodistinguishoneautomaticlicense
implementationfromanother,allowingsubsequentlicensestobecreatedby
newerversionsoftheprotectedprogram.Theversionnumbercanbeavalue
from1to32.
Copies
Thecopiesparameteristhenumberoffixedlicensecopiesthatyouwantto
granttheuserwhenthefunctionisrun.
Return Value
SeetheReadyToTry()functiondescriptioninSection12.3.28:ReadyToTry()for
alistofreturnvalues.
Notes
Theversionparameternormallybeginsat1andproceedsincrementally
upwardsforeachnewreleaseoftheprogram.
Inordertocreateafloatinglicensewithaspecificnumberofmultiusers,you
canenteranegativevalueinthecopiesparameter.Thisresultsinthecreation
ofafloatinglicensewithanumberofusersequaltotheabsolutevalueofthe
numberentered(e.g.,7createsafloatinglicensewith7users).
2 3 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.31 RegisterTransfer()
TheRegisterTransfer()functioniscalledfromanapplicationthatdoesnotyet
haveauthorizationandregisterstheapplicationbyplacingregistrationfileson
adiskordirectory.Theseregistrationfilesareusedbyanapplicationthatdoes
haveauthorizationtotransfertheauthorization.
Usage
ThedirectoryfortransferismostlikelyA:\becausethetransferisusuallyfrom
onecomputertoanotherusingafloppydisk.However,thistransfercouldbe
fromonedirectorytoanotheronthesamecomputer,orevenfromone
networkdrivetoanother.Forthisreason,theusermustbeabletoenterthis
parameter.
Prototypes
Language Syntax
C int RegisterTransfer (char *directory);
Parameter
Directory
Thedirectoryparameterisapointertoanullterminatedtextstringthat
containsthepathofthedirectorywheresomeencryptedtextfiles(the
registration)areplaced.
C RY P K E Y S D K 2 3 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
2 3 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.32 SaveSiteKey()
TheSaveSiteKey()functionisusedtosavetoafilethesitekeyissuedtothe
user.Thekeyischeckedfirstbeforeitissaved.
Usage
IftheprogramdetectsitisnotauthorizedviatheGetAuthorization()function,
itmust,atminimum,showtheprogramssitecodeandallowtheusertoentera
sitekey.
C RY P K E Y S D K 2 3 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Prototypes
Language Syntax
C int SaveSiteKey (char *site_key);
Parameters
Site_key
Thesite_keyparameterisapointertothestringcontainingtheuserenteredsite
key.Spacesareremovedfromthekeybythisfunctionbeforeitisprocessed.
Return Value
2 3 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
GeneralerrorvaluesalsoapplyseeSection12.2:GeneralErrorValues.
Note
SeeSection5.1:BasicProgrammingStepsformoreinformation.
GetSiteCode()mustbecalledbeforetheSaveSiteKey()functioniscalled.We
recommendthatyoualwaysshowthesitecodetotheuserbeforeorwhile
allowingtheusertoenterthesitekey.
YoushouldalwayscallGetAuthorization()tofindoutthechangeinthestateof
thelicenseimmediatelyafterthisfunction.
12.3.33 SetNetHandle()
TheSetNetHandle()functionsetsthenetworklicensehandle(i.e.passesthe
handleofaSLAPInetworkresourcetotheprogram).
C RY P K E Y S D K 2 4 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Usage
IfyouwantseveralSLAPIlicensedprogramssharingasinglenetworkseat,you
canuseGetNetHandle()togetthehandleandthendistributeitusingthe
SetNetHandle()function.TheSetNetHandle()functionshouldalwaysbe
calledafterthecalltoInitCrypkey()ismadeandbeforetheGetAuthorization()
callismade.
Prototypes
Language Syntax
C void SetNetHandle (unsigned short net_handle);
Parameter
Net_handle
Net_handleisahandletoanetworkresourceobtainedbycalling
GetNetHandle().
Note
OnlyoneoftheprogramssharingthenetworkseatcancallEndCrypkey()
successfullypreferably,thelastprogramtostopexecutingcallsthisfunction,
sincethismeansthatthenetworkseatisclearlynolongerrequired.
12.3.34 TransferIn()
Calledfromanapplicationthatdoesnothaveauthorization,theTransferIn()
functionimportsanotherauthorizationlicensebyreadingthetransferfiles
fromafloppydiskordirectorycreatedbytheTransferOut()function.Tobea
validtransfer,thesitecallingthisfunctionmusthavebeguntheprocessby
usingtheRegisterTransfer()function.
2 4 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Usage
ThedirectoryfortransferismostlikelyA:\becausethetransferisusuallyfrom
onecomputertoanotherusingafloppydisk.However,thistransfercouldbe
fromonedirectorytoanotheronthesamecomputerorevenfromonenetwork
drivetoanother.Forthisreason,theusermustbeabletoenterthisparameter.
Prototypes
Language Syntax
C int TransferIn (char *directory);
Parameter
Directory
Thedirectoryparameterisapointertoanullterminatedtextstringthat
containsthepathofthedirectorywherethelicensefilesareimported.
C RY P K E Y S D K 2 4 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
2 4 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
C RY P K E Y S D K 2 4 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 4 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
GeneralerrorvaluesalsoapplyseeSection12.2:GeneralErrorValues.
Notes
SeeSection9:MovingProtectedProgramsformoreinformation.
C RY P K E Y S D K 2 4 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
12.3.35 TransferOut()
Calledfromanapplicationthathasauthorization,theTransferOut()function
exportstheapplicationsauthorizationlicensebyplacingtransferfilesona
floppydiskorinadirectorywherearegistrationfilealreadyexistsfromacallto
theRegisterTransfer()function.Thesetransferfilesmustbeusedbythesame
applicationthatcreatedtheinitialregistrationfilestotransferthelicensein.
Usage
ThedirectoryfortransferismostlikelyA:\becausethetransferisusuallyfrom
onecomputertoanotherusingafloppydisk.However,thistransfercouldbe
fromonedirectorytoanotheronthesamecomputerorevenfromonenetwork
drivetoanother.Forthisreason,theusermustbeabletoenterthisparameter.
Prototypes
Language Syntax
C int TransferOut (char *directory);
Parameter
Directory
Thedirectoryparameterisapointertoanullterminatedtextstringthat
containsthepathofthedirectorywherethelicensefilesareexported.
2 4 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Return Value
C RY P K E Y S D K 2 4 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
2 4 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
GeneralerrorvaluesalsoapplyseeSection12.2:GeneralErrorValues.
Note
SeeSection9:MovingProtectedProgramsformoreinformation.
C RY P K E Y S D K 2 5 0
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
Section
1
3
Appendix I Sample File
Thissectioncontainsafile,example.c,thatshows
samplecode.Toviewthecrypkey.hfileandotherfiles
containing16and32bitsamplecode,lookatthe
samplesdirectorywehaveprovided.
everalexamplefilesareavailableinyourCrypKeyv6.0installation
S directories,showingCrypKeyfunctioncallsfromavarietyofprogramming
environments.Somesamplesaresuppliedbycustomers.Allcanbe
improvedupon.
EXAMPLE.Cisthebestonetolookatforasimpledemonstrationofhow
functioncallsworktogethertoprotectandlicenseanapplication.
The16bitsamplestendtobeabitoutdatedcheckthemanualforthelatest
informationifyouareusingthese.The32bitsamplesprovidegoodreference
information,aswellassomeinterfaceideas.
Eachexampleisalittledifferent,andworthalookjusttoseehowtheauthor
usesCrypKey.
ThecompiledexecutablesformostsamplescanbefoundintheDEMOS
directory.
2 5 1 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
ImportantNoteforVisualBasic:becauseofapropertyofVBintegers,function
declarationsfor32bitcodeand16bitcodearenotthesame.Youcangetthe
functiondeclarationsfor32bitcodefromtheFORJIMsample.
13.1 Example.c
/**************************************************************************
*FILETYPE:maincode
*FILE:EXAMPLE.C
*PURPOSE:SimpleexampleofCrypKeySoftwareLibraryusage
*PROGRAM:EXAMPLE.EXE
*LINKS:lcrypkey.libcrypkeylibrarylargemodel
*INCLUDES:stdio.hcrypkey.cstime.h
*COPYRTS:CRYPKEYCANADAINC.
*AUTHOR:JamesMcCartney
*CREATED:June25,1992
**************************************************************************/
#ifdefWIN32
#include<windows.h>
#endif//WIN32
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<conio.h>
#include<dos.h>
#include<malloc.h>
#include"crypkey.h"
/***************Functionsinthisfile********************************/
intdo_auth(void);
unsignedlongtime100();/*getstimeofdayto1/100th*/
USHORTchallenge(ULONGcompanyNum,ULONGpassNum,USHORTrandom1,USHORT
random2);
intPrintFloatingLicenseSnapshot(void);
longchallenge32(longcompanyNum,longpassNum,longrandom1,longrandom2);
/***************Functionsinthisfile********************************/
/***************DefinesandGlobals***********************************/
//Thesearepersonalizedkeysthatareissuedtoyouuponpurchaseofcrypkey
#defineUSER_KEY"D050815CD1A2A79DB1"
#ifdefWIN32
//Usethisifprogramis32bit
#defineMASTER_KEY"f2c938d2d34678d2e9217c18d78ea6a8e466cf49520f92cdd1b6916\
bd460d60e7c7b4cc7cc1750bd7188f90ac132b915e82fc8fa60a1d299da0f28ea3c66bd42db\
0be62149daaee4dba55c0e70ce1c13bd343f8b7573abc1e7da0695955ab2bd377f50a9be29a\
04cf816b30cd171e1509ad65100c999e52a35f45a215212a970"
#else
//Usethisifprogramis16bit
//#defineMASTER_KEY"2A5D57C41B4C135BF09E17F7600B2D7079E8F275C36A"
#endif
#defineCHECKPERIOD15//secondsbetweenauthorizationchecksonanetwork
//itis10justfordemo,10minismorepractical
C RY P K E Y S D K 2 5 2
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
char*authTypes[]={"NONE","TIME(DAYS)","RUNS"};
/***************DefinesandGlobals***********************************/
/**************************************************************************
*FUNCTION:main
*PURPOSE:simpledemonstrationofCrypKey
*ARGUMENT:n/a
*CALLS:TheCrypKeyAPI
*RETURNS:n/a
*REVISED:Nov16,1997forVer4.3
**************************************************************************/
main(intargc,char*argv[])
{
//theseareusedinckChallenge(),whichisaverificationfunction
#defineCOMPANYNUM79560//thesearethecorrectnumbersforexample.exe
#definePASSNUM984534120//youcanusetheminyourtestsifyouneedto
intdone=FALSE;
intret,err,c,i,num_tries=0;
intauthopt,num_allowed,num_used;//restrictioninfo
ULONGlevel,start_date,start;
charpath[400],timestring[30];
charserial[100],model[100],firmware[50];
intGMIret;
printf("CrypKeyTestProgrampath=[%s]\n\n",argv[0]);
/********************************************************************
MASTERKEYandUSERKEYareissueduponpurchaseofCrypKey
TheyinsurethatSite_Keycanonlygeneratekeysforyourproduct
*********************************************************************/
//initcrypkeybeforeusinganyotherfunctions
//printf("StartInit\n");
err=InitCrypkey(argv[0],MASTER_KEY,USER_KEY,FALSE,3*CHECKPERIOD);
//printf("DoneInit\n");
if(err)
{
printf("InitializationFailure%s(%d)for%s\n",
ExplainErr(EXP_INIT_ERR,err),err,argv[0]);
return(0);
}
printf("InitializationOKCrypKeyVersion%d\n",CrypkeyVersion());
GMIret=GetDrivePermanentSerialData(model,serial,firmware);
if(GMIret)
printf("GETSERIAL:err=%d%s\n",GMIret,ExplainErr(EXP_HDSN_ERR,GMIret));
else
printf("\n===============================================\nPermanentHard
DriveData!:\nSerial=%s\nModel=%s\nFirmware=
%s\n===============================================\n\n",serial,model,
firmware);
printf("Hitakeytocontinue");
getch();
printf("\n");
2 5 3 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
err=GetAuthorization(&level,1);//checkauthorization,useup1run
//Usethechallengefunctiontocheckthelibraryisnotanimpostor
//ThisonlyneedstobedoneifyouareusingtheDLL
//Itisshownherefordemonstrationpurposeonly
if(err==0)//checkthisonlyifwethinkweareauthorized
#ifdefWIN32
//Checknew32bitchallenge
{
ULONGrandom1,random2,result1,result2;
//generatesomerandomnumbersthiscanbedoneanywayyoulike
random1=time(NULL);
random2=random1*time(NULL);
result1=challenge32(COMPANYNUM,PASSNUM/2,random1,random2);
result2=CKChallenge32(random1,random2);
if(result1!=result2)
{
printf("Challenge32functionfailedprogramaborting\n");
printf("chal=%uckChal=%u\n",result1,result2);
exit(1);
}
else
printf("Challenge32functionsuccessful!\n");
}
#else
//use16bitchallengefunction
{
USHORTrandom1,random2,result1,result2;//noteUSHORTthesemustbe16
bit!
//generatesomerandomnumbersthiscanbedoneanywayyoulike
random1=(unsignedshort)time(NULL);
random2=random1*(unsignedshort)time(NULL);
result1=challenge(COMPANYNUM,PASSNUM,random1,random2);
result2=CKChallenge(random1,random2);
if(result1!=result2)
{
printf("Challengefunctionfailedprogramaborting\n");
printf("chal=%uckChal=%u\n",result1,result2);
exit(1);
}
else
printf("Challengefunctionsuccessful!\n");
}
#endif
elseif(err<0)//OnlyifwearenotauthorizedTryforatriallicense
{
printf("AttemptingtogenerateaTrialLicensethismaytakeaminute\n");
ret=ReadyToTryDays(33,3,1,1);//Level33,3Days,Version1,1copy
printf("ReadyToTryreturned%d%s\n",ret,ExplainErr(EXP_RTT_ERR,ret));
}
/*********************************************************************
Note:thisprogramloopstoprovideanetworkexample.
YourprogramonlyneedstoperiodicallycallGetAuthorizationif
multiplenetworkcopiesaretoberanconcurrentlyonanetwork.
/*********************************************************************/
ungetch('');//forceitthroughthelooponcetoprintauthorizationstate
start=0;//timingloop
while(!done)
{
if(!kbhit())
{
C RY P K E Y S D K 2 5 4
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
printf("[A=Authorize][D=DirectTransfer][L=AcquireLicense]\n[1=RunOnce]
[K=KillLicense][R=Registersite]\n[S=FloatingLicenseUser
Snapshot]\n[O=TranferOut][I=TransferIn][Q=Quit]\n");
printf("What'syourambition?:");
}
while(!kbhit())
{
if((time(NULL)start)>CHECKPERIOD)
{
num_tries++;
start=time100();
err=GetAuthorization(&level,0);
start=time100()start;
if(!err)
{
printf("\nAuthorizationcheck#%dtook%ldms:%s\n",
num_tries,start*10,
ExplainErr(EXP_AUTH_ERR,err));
}
else
{
printf("\nAuthorizationcheck#%dtook%ldms:%s\n",
num_tries,start*10,
ExplainErr(EXP_AUTH_ERR,err));
}
start=time(NULL);
}
}
c=getche();
printf("\n");
switch(c)
{
case'A':case'a':
do_auth();
break;
case'D':case'd':
{
chardtPath[120];
printf("Enterthepathofthecopyofthisprogramtotransferlicense
to:\n");
scanf("%s",dtPath);
err=DirectTransfer(dtPath);
printf("DirectTransfer:%d%s\n",err,ExplainErr(EXP_DT_ERR,err));
}
break;
case'L':case'l':
{
chardtPath[120];
printf("Enterthedirectorytotransferlicensefrom:\n");
scanf("%s",dtPath);
err=AcquireLicense(dtPath);
printf("AcquireLicense:%d%s\n",err,ExplainErr(EXP_AL_ERR,err));
}
break;
case'Q':case'q':
EndCrypkey();
done=TRUE;
break;
2 5 5 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
case'R':case'r':
printf("Pathtoplaceregistrationfile:");
scanf("%s",path);
printf("\n");
err=RegisterTransfer(path);
printf("REG:%s\n",ExplainErr(EXP_REG_ERR,err));
break;
case'O':case'o':
printf("Pathtofindregistrationfile:");
scanf("%s",path);
printf("\n");
err=TransferOut(path);
printf("TO:%s\n",ExplainErr(EXP_TO_ERR,err));
break;
case'I':case'i':
printf("Pathtofindtransferfiles:");
scanf("%s",path);
printf("\n");
err=TransferIn(path);
printf("TI:%s\n",ExplainErr(EXP_TI_ERR,err));
break;
case'K':case'k':
{
intret;
intc;
chars[50];
printf("ThiswilldeleteyourlicensepressYtoverify:");
c=getche();
printf("\n");
if((c!='Y')&&(c!='y'))
break;
ret=KillLicense(s);
printf("KillLicense()returned%d,Verification:%s\n",ret,s);
err=GetAuthorization(&level,0);//updateourstatus
}
break;
case'1':
err=GetAuthorization(&level,1);//checkauthorization,useup1run
printf("RunOnce%s\n",ExplainErr(EXP_AUTH_ERR,err));
break;
case'S':case's':
err=PrintFloatingLicenseSnapshot();
printf("Snapshotreturneda%d\nHitanykeytocontinue\n",err);
start=time(NULL);
while(!kbhit())
if((time(NULL)start)>CHECKPERIOD/2)//don'twaitso
longwelosethelicense
break;
while(kbhit())getch();
printf("\n");
break;
default:break;
}
err=GetAuthorization(&level,0);//rechecktheauthorization
C RY P K E Y S D K 2 5 6
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
printf("=================================================================\n");
printf("Thisfileis%sauthorizedatthissite:%s\nLEVEL=%ld\n",
(err==0)?"now":"NOT",ExplainErr(EXP_AUTH_ERR,err),level&0x00FF);
printf("OPTIONSAvailable:");
//Notethatthisprogramhas8optionsdefinedinskw.ini
//Therefore,wecheckthetop8bitsof'level'fortheseoptions
//Wecouldalsouseget_option,anewfunctionthatiseasiertouse
for(i=31;i>23;i)
if((1L<<i)&level)
printf("#%d",32i);
//displayrestrictions
ret=GetRestrictionInfo(&authopt,&start_date,&num_allowed,&num_used);
if(ret==0)
printf("RESTRICTIONS:TYPE:%sSTART:%s\n#ALLOWED:%d#USED:%d\n",
(authopt<0)?"N/A":authTypes[authopt],CKTimeString(timestring,start_date),
num_allowed,num_used);
printf("NumberofCopiesallowedfromthissite:%d\n",get_num_copies());
printf("NumberofNetworkUsersallowedfromthissite:
%d\n",get_num_multi_users());
/*
{
intserr,stz;
serr=GetServerTimeZone(&stz);
printf("ServerTimeZone=%derr=%d\n",stz,serr);
}
*/
printf("=================================================================\n\n")
;
#ifdefTEST_OTHER_CALLS//definethistoseeothercallsinaction
printf("Sitecodeis%s\n",GetSiteCode2());//somelanguagesneedtousethis
//inteadofget_site_code()
printf("Level=%d\n",get_level(8));
for(i=1;i<=8;i++)
printf("Opt%d=%d",i,get_option(8,i));
printf("\n");
printf("RESTRICTIONS:TYPE:%s#ALLOWED:%d#USED:%d\n",
authTypes[Get1RestInfo(1)],Get1RestInfo(2),Get1RestInfo(3));
ExplainErr2(1,2,text);
printf("Errortextforfunc1err2is\n[%s]\n",text);
printf("=================================================================\n\n")
;
#endif
}
EndCrypkey();
return(0);
}
/**************************************************************************
*FUNCTION:do_auth()
*PURPOSE:doestheSiteCodeSiteKey()transactionwiththecustomer
*ARGUMENT:none
*RETURNS:nonzeroiferror
**************************************************************************/
2 5 7 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
intdo_auth()
{
interr;
charsite_code[50],key[50];
if(err=GetSiteCode(site_code))//lettheuserauthorize
{
printf("GETSITECODE:%s%d\n",ExplainErr(EXP_GET_SITECODE_ERR,err),err);
//printf("InitializationFailure'%s'isnotthepathofthisfile\n");
return(0);
}
printf("SiteCode:%s\nEnterSiteKeyor'.'toquit:",spc(site_code));
key[0]=0;
while(!kbhit());//waitforentry
gets(key);
if(key[0]=='.')
return(0);
err=SaveSiteKey(key);
printf("%s\n",ExplainErr(EXP_SAVE_SITEKEY_ERR,err));
return(0);
}
/**************************************************************************
*FUNCTION:time100()
*PURPOSE:getstimeofdayin100sofseconds
*ARGUMENT:n/a
*RETURNS:timeofdayinhundredsofseconds
**************************************************************************/
unsignedlongtime100()/*getstimeofdayto1/100th*/
{
#ifdefWIN32
SYSTEMTIMEt;
GetSystemTime(&t);
return((t.wHour*60+t.wMinute)*60+t.wSecond)*100+t.wMilliseconds/10;
#else
structdostime_tt;
_dos_gettime(&t);
return((t.hour*60+t.minute)*60+t.second)*100+t.hsecond;
#endif//notWIN32
}
/**************************************************************************
*FUNCTION:challenge()
*PURPOSE:doesthecalculationfortheCrypKeyckChallengeverification
*ARGUMENT:companyNumassignedbyKenonic
passNumassignedbyKenonic
random1makeoneupyourself
random2makeoneupyourself
*RETURNS:nonzeroiferror
**************************************************************************/
USHORTchallenge(ULONGcompanyNum,ULONGpassNum,USHORTrandom1,USHORT
random2)
{
inti;
ULONGret,r1,r2;
r1=(ULONG)random1;
C RY P K E Y S D K 2 5 8
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
r2=(ULONG)random2;
ret=0;
for(i=0;i<11;i++)
ret=(ret*r1+companyNum)%16381L+(ret*r2+passNum)%16369L;
return(USHORT)ret;
}
intPrintFloatingLicenseSnapshot(void)
{
FLS_REC*buf;
intret,numEntries,i;
unsignedlongbufSize;
chartimestring[30];
//allocateabuffer
bufSize=(unsignedlong)sizeof(FLS_REC)*ABS_MAX_USERS;
if((buf=(FLS_REC*)malloc(bufSize))==NULL)
{
printf("Couldnotallocateenoughspaceforthis!\n");
return99;
}
ret=FloatingLicenseSnapshot(bufSize,&numEntries,buf);
if(ret!=0)
printf("Error%d%s\n",ret,ExplainErr(EXP_FLS_ERR,ret));
else
{
printf("\nFloatingLicenseSnapshot:%dEntriesret=%d\n\n",numEntries,ret);
printf("StatusDate/TimeStartedComputerNameUserName\n");
printf("==============================================================\n");
for(i=0;i<numEntries;i++)
printf("%6d%s%15s%15s\n",buf[i].status,
CKTimeString(timestring,buf[i].starttime),
buf[i].computerName,buf[i].userName);
printf("==============================================================\n");
}
free(buf);
return(ret);
}
#ifdefWIN32
/**************************************************************************
*FUNCTION:challenge32()
*PURPOSE:doesthecalculationfortheCrypKeyckChallenge32verification
*ARGUMENT:companyNumassignedbyKenonic
passNumDiv2assignedbyKenonic
random1makeoneupyourself
random2makeoneupyourself
*RETURNS:nonzeroiferror
*NOTES:Thisfunctionuseslongs,notunsignedlongs,tobeVBfriendly
Ifunsignedlongsareaccidentlyused,itwillnotwork
**************************************************************************/
longchallenge32(longcompanyNum,longpassNumDiv2,longrandom1,longrandom2)
//VBusersshoulddividetheirPassNumby2manually,beforecodingit,
//togetPassNumDiv2
{
inti;
longret;
2 5 9 C RY P K E Y S D K
U S E R M A N U A L
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
ret=1;
for(i=2;i<11;i++)
{
ret=ret%32769*((random1/i)%32769+(companyNum/i)%32769);
ret=ret%32769*((random2/i)%32769+(passNumDiv2/i)%32769);
}
return(ret);
}
#endif
C RY P K E Y S D K 2 6 0
U S E R M A N U A L
Appendix II Quick Reference
Section
1
4
14.1 CrypKey Functions
FollowingarebriefdescriptionsofCrypKeyfunctionsandtheirCprototypes.
Formoredetails,includingtheirprototypes,seeChapter12:Function
Reference.
AcquireLicense() EndCrypkey()
allows an unlicensed CrypKey protected program to acquire a Notifies CrypKey that the program is stopping. This function is
license from a licensed copy. only necessary if you are using Network features.
int AcquireLicense (char *licensePath); void EndCrykey();
CKChallenge() ExplainErr()
Verifies that the CryKey DLL has not been replaced with an Returns a text string explaining the return code of various
impostor DLL. functions.
unsigned int CKChallenge (unsigned int random1, unsigned char far *ExplainErr(int functioncode, int errcode);
int random2);
CKChallenge32() ExplainErr2()
Verifies that the CryKey DLL has not been replaced with an Returns a text string explaining the return code of various
impostor DLL. functions. This function is similar to the Explain Err() function,
long CKChallenge32 (long random1, long random2); but your error message is written into your string text.
void ExplainErr2(int functioncode, int errcode, char *text);
CKTimeString() FloatingLicenseGetRecord()
Translates, into a text string, the ULONG time values returned Used only in COM Objects and C#.NET Assemblies: called from
by the functions GetAuthorization() and an application that has authorization, this function returns a
FloatingLicenseSnapshot(). single record of the current floating license status.
char * FUNCTYPE CKTimeString(char *timestringbuf, ULONG t) [Prototypes available for C++ and C#.NET but not for C or VB.]
CrypKeyVersion() FloatingLicenseSnapshot()
returns the version number of the CrypKey system currently in Returns a snapshot of all users holding or waiting for a network
use. floating license.
int CrypkeyVersion (); int FloatingLicenseSnapshot (unsigned long bufSize, int
*numEntries, FLS_REC *buf);
DirectTransfer()
Called from an application that has authorization, this function
transfers the applications authorization license to another
directory.
int DirectTransfer(char far *directory);
FloatingLicenseTakeSnapshot() GetNumMultiUsers()
Used only in COM Objects and C#.NET Assemblies: returns a Gets the number of multi-users this site has been granted.
snapshot of all users holding or waiting for a network floating int GetNumMultiUsers();
license.
[Prototypes available for C++ and C#.NET but not for C or VB
see Sec. 12.3.11: FloatingLicenseSnapshot.]
Get1RestInfo() GetOption()
Used to return one of three different types of data depending Used to determine the status of a specific option.
on the value of the which input parameter. int GetOption(int numDefineOpts, int optnum);
int Get1RestInfo(int which);
which can be 1 returns authopt, 2 returns num_allowed,
3 runs num_used
GetAuthorization() GetRestrictionInfo()
Gets the level at which the program is authorized to run or an Gets information on any restrictions that are present in the
authorization failure code. Also used to decrement the number license.
of uses count. Must be called, together with InitCrypKey, int GetRestrictionInfo (Int far *authopt, ULONG far
before any other CrypKey function. *start_date, int far *num_allowed, int far *num_used);
int GetAuthorization(unsigned long *oplevel, int decrement);
GetAuthorization2() GetSiteCode()
Determines if the program is authorized to run, and Gets the site code for this program location. The site code
decrements the license count but does not obtain option must be reported by the customer before the developer can
and level information. issue the site key.
int GetAuthorization2 (int decrement); int GetSiteCode(car far *site_code);
GetDrivePermanentSerialData() GetSiteCode2()
proprietary CrypKey software function that accesses the Returns a pointer to the site code for this program location.
following hard drive information on a customers computer: char *GetSiteCode();
model number, serial number, firmware data.
GetLastError() InitCrypkey()
Returns the text for the last error reported. Initializes CrypKey with runtime information. This function and
[Prototypes available for C++, VB and C#.NET but not for C.] GetAuthorization() must be called before any other function
in CrypKey.
int InitCrypkey(char far *filepath, char far *masterkey, char
far *userkey, int allow_floppy, unsigned
network_max_checktime);
GetLastErrorCode() KillLicense()
C#.NET function only: returns the number of the last error Disables an existing license and provides a confirmation code
reported. that can be entered into the Site Key Generator in order to
long GetLastErrorCode(); display the details of the de-authorization.
int KillLicense (char *confirmCode);
GetLevel() ReadyToTry()
Used to determine the level at which your program has been Implements a one-time automatic license based on a days
authorized to run. time period, without version control.
Unsigned long GetLevel(int numDefineOpts); int ReadyToTry (unsigned long oplevel, int numDays);
GetNetHandle() ReadyToTryDays()
Gets and returns the network license handle of the protected Implements a one-time automatic license based on a days
program. time period, with version control.
int ReadyToTryDays (unsigned long oplevel, int numDays, int
GetNumCopies() version, int copies);
Gets the number of license copies that the current site has
been granted.
ReadyToTry_Runs()
Implements a one-time automatic license based on a runs
restriction with version control.
int ReadyToTryRuns (unsigned long oplevel, int numRuns, int
version, int copies);
RegisterTransfer()
Called from an application that does not yet have
authorization, this function registers the application by placing
license imprint files on a disk or in a directory.
int RegisterTransfer(char far *directory)
SaveSiteKey()
This function is used to save to file the site key that has been
acquired from the user. The key is checked before it is saved.
int SaveSikeKey(char far *site_key);
SetNetHandle()
Sets the network license handle, i.e. passes the handle of a
SLAPI network resource to the program.
void SetNetHandle (unsigned short net_handle);
TransferIn()
Called from an application that does not have authorization,
this function transfers the applications authorization license in
by reading transfer out license imprint files on a disk or in a
directory.
int TransferIn(char far *directory);
TransferOut()
Called from an application that has authorization, this function
transfers the applications authorization license out by placing
license imprint files on a disk or in a directory.
int TransferOut(char far *directory);
14.2 CrypKey Return Codes
InitCrypkey() GetAuthorization()
Defined Name within Return Defined Name within Return
CRYPKEY.H Value CRYPKEY.H Value
INIT_OK 0 AUTH_OK 0
INIT_FILE_NOT_FOUND -1 AUTH_INIT_FAIL -1
INIT_MASTERKEY_CRC_FAILU -2 AUTH_DISALLOW_FLOPPY -2
RE
INIT_BAD_PRODUCT_NAME -3 AUTH_BAD_PATH -3
INIT_KEYFILE_CREATION_FAIL -4 AUTH_NOT_PRESENT -4
INIT_NETWORK_NOT_PURCH -5 AUTH_DIFFERENT -5
ASED
INIT_NT_NOT_PURCHASED -6 AUTH_BAD_MASTERKEY -6
INIT_NT32BIT_NOT_PURCHAS -7 AUTH_SITEKEY_CRC -7
ED
INIT_WIN95_NOT_PURCHASE -8 AUTH_TIME_TOO_EARLY -8
D
INIT_WIN32S_NOT_PURCHAS -9 AUTH_TIME_SETBACK -9
ED
INIT_MULTIPLE_CALL_TO_INIT -10 AUTH_TIME_RUNOUT -10
INIT_THUNK_LIB_NOT_FOUN -11 AUTH_RUNS_RESTR -11
D
INIT_THUNK32_DLL_CORRUP -12 AUTH_NOT_ENOUGH_RUNS -12
T
INIT_THUNK16_DLL_CORRUP -13 AUTH_MISSING_RST_FILE -13
T
INIT_32_DLL_CORRUPT -14 AUTH_RST_BAD_CRC -14
INIT_THUNK32_DLL_VERSION -15 AUTH_RST_BAD_LOCATION -15
INIT_THUNK16_DLL_VERSION -16 AUTH_ENTRY_CHECK_FAIL -16
INIT_THUNK32_DLL_TAMPER -17 AUTH_NETTABLEFILE_FAIL -17
ED
INIT_THUNK16_DLL_TAMPER -18 AUTH_NETMAX_EXCEEDED -18
ED
INIT_THUNK32_DLL_UNKNO -19 AUTH_NETWORK_NOT_ALLO -19
WN ERROR WED
INIT_THUNK16_DLL_UNKNO -20 AUTH_RSTFILE_WRITE_PROT -20
WN ERROR EC
INIT_PRE_V6_MASTERKEY -21 AUTH_TIME_CLOCK_TAMPERI -21
NG
KEY_BAD_LOCATION -22
Legend:
Indicates files required for 16Bit applications.
Indicates files required for 32Bit applications.
Indicates optional files depending on XP Home Edition/Pro compatibility mode
settings.
Cells with a gray background indicate files required for a network.
Files in italics are specific to CrypKey Instant.
Files in gray text are specific to CrypKey SDK.
Files in regular black text are common to both SDK and Instant.
CRYPKEY INSTANT refer to Sections 3.6.1 and 3.6.2 in the CrypKey Instant
Manual
CRYPKEY SDK refer to Sec. 2.6, Libraries and Distribution Files and Table 3:
Libraries, in the CrypKey SDK manual
Notes
1. setupex.exe and cks.exe are files used to install the NT driver (Crypkey License
Service) required on all NT systems whether networked or stand-alone.
2. wckserve.exe is required for Win9X/ME servers
3. splash.int is required for custom splash screen. See online database for more
information.
4. See online database for more information regarding language support.
5. Thunk files for Win9X/ME go into the application or license directory only.
6. If you use static libraries, crp32dll.dll or lcrypkyd.dll do not need to be
distributed.
Figure 57: CrypKey Program Flowchart
Figure 58: Example Win9X/ME CrypKey Configuration
Glossary
Thisglossarycontainsdefinitionsoftermsusedinthis Section
1
manual.
5
hetermscommonlyusedinthismanualaredefinedinthissection.These
definitionshelpyouunderstandtheCrypKeySDKproductandits
protectionstrategies.
.NET
.NETisaframeworkforobjectsandhowtheyworktogether..NETobjectsare
languageneutralandmaybewritteninC#,C++,VisualBasic,J#,orother
languages.Thecodegeneratedfor.NETisanintermediatelanguagethatneeds
theCommonLanguageRuntime(CLR)tointerpretthecode.Theuseofthe
CLRallows.NETcodetorunondifferentoperatingsystemsandplatforms
withouthavingtorecompilethecode.
.NET Assembly
A.NETassemblyisafilecontaining.NETclasses.Theassemblycontainsclass
definitionsthatallowother.NETprogramstoidentifyandusetheclasses
withinit.
Automatic License
ThisisalicensethatiscreatedbyusingtheReadyToTry()functionoroneofits
variants.Suchlicensesarecreatedautomaticallybythesoftwarewithout
requiringyouoryourdistributortoprovideasitekey.
Common Object Model (COM)
TheCommonObjectModelisaspecificationforobjectsandhowtheywork
together.COMobjectsarelanguageindependentandmaybewritteninC++,
VisualBasic,Java,orotherlanguages.ThecodegeneratedforCOMisstandard
Windowsmachineexecutablebinaries.
COM Object
ACOMobjectisafilecontainingCOMclasses.TheCOMobjectcontainsclass
definitionsthatallowotherCOMprogramstoidentifyandusetheclasses
withinit.
Company Number
ThisisoneoftwospecialkeysusedintheCKChallenge()function(theother
keyisthepasswordnumber).Thecompanynumberkeyisbasedonaprivate
numberthatCrypKeyassignstoyourcompany.
Developer Keys
ThesearethefourkeysthatCrypKeyissuesyouafterreceivingpayment.These
include:
companynumber
passwordnumber
MasterKey
UserKey
Fixed License
Aproductlicenseusableonlyonthecomputerwhereitwasinstalled(node
lockedlicense).Althoughtheprogramcanbecopiedtoothercomputers,its
inherentsecurityensuresitcanonlyrunonthecomputerwhereitwas
installed.
Floating License
Aproductlicensethatallowsapredeterminednumberofproductcopiesto
runconcurrentlyonvariousclientcomputersfromasingle,networkedserver
copy.
Level
Aparameterdefinedforaproductlicense.TheSiteKeyGenerator
communicatestheleveltoyourproductviathesitekey,enablingyoutocontrol
howyourproductrunsandwhichinstanceofyourproductisauthorized.
CrypKeySDKcommunicatesonlythelevelvaluetotheprotectedapplication;
youmustimplementtheaction(s)withintheproductbasedonthelevel.
License
Aprotectedproductsauthorizationisdefinedbythelicense.Thelicense
containsdetailsoftheauthorization,includinglevels,options,licensetype,and
licenserestriction.Inphysicalterms,thelicenseconsistsoffourhiddensystem
filesthatresideinthesamedirectorylocationastheprotectedprogram.
Master Key
AhexadecimalnumberissuedbyCrypKey,basedonyourcompanynumber
andproductname.TouseCrypKeywithyourproduct,youneedaMasterKey
andUserKey(thesekeysareenteredintotheInitCrypkey()function).
Option
Selectionofaspecificationthatmayincludeorexcludeacomponentaspartof
aproductlicense.Together,thenumericsymbolsfortheoptionsandlevels
definedforyourproductcomprisea32bitnumberusedaspartofthesitekey.
Password Number
OneoftwospecialkeysusedintheCKChallenge()functionwhenusingthe
CrypKeyAPI(theotherkeyisthecompanynumber).Thepasswordnumberis
basedontheproductpassword,whichyouspecify.CrypKeycreatesthe
passwordnumberfromyourproductpasswordandprovidesittoyou.
Site
Insoftwarelicensing,theinternalbootdevice(harddrive)ofthecomputer
whereaprotectedprogramisinstalled.Thetermisgenerallysynonymouswith
thecomputeritself.
Site Code
Asitespecifichexadecimalnumberissuedbyaprotectedproductwhen
installedonaclientscomputer.ThesitecodeisprovidedbytheGetSiteCode()
function.Yourcustomersprovidethesitecodewhenrequestinglicensing
changesfortheproduct.
Site Key
Ahexadecimalnumberbasedonaclientssitecode,createdbyviatheSiteKey
Generator.Thesitekeyunlocksclientsoftwarefeaturesandlicenserestrictions.
User Key
AhexadecimalnumberissuedbyCrypKey,basedonyourproductpassword.
TouseCrypKeywithyourproduct,youneedaMasterKeyandaUserKey
(enterthesekeysintheInitCrypkey()function).
Index
Thisindexincludespagereferencesforsignificant Section
1
occurrencesoftopicsandterms.
6
ysignificantoccurrences,wemeanappearancesofatermwhere
informationisprovidedaboutitsmeaningoruseintheCrypKeycontext.
Whereappropriate,wehavealsoprovidedseealsocrossreferences
betweenterms.
.
.NET assembly......................................................42, 48, 96, 166, 182, 196
A
AcquireLicense().....................................................................................181
anti-virus software..................................................................................148
authorization transfer
into target computer...........................................................................92
out of source computer.......................................................................92
registering........................................................................................... 91
authorizing
distributors.......................................................................................... 80
MS-DOS program.................................................................................57
Site Key Generators............................................................................78
Windows program...............................................................................51
your program......................................................................................91
automatic license...................................................................................259
C
CD-ROM distribution...............................................................................146
certification............................................................................................. 148
CKChallenge32().............................................................................172, 173
cks.exe.................................................................................................... 131
ckserve.exe.......................................................................................44, 132
ckserver.nlm.....................................................................................45, 131
client annoyance....................................................................................142
clock manipulation.................................................................................146
CloneBuster........................................................................................18, 63
computer signatures...............................................................................143
cryp9516f.dll............................................................................................. 48
cryp95f.dll................................................................................................. 48
CrypKey Instant........................................................................................16
CrypKey SDK
features...........................................................................................1, 17
installation.......................................................................................... 24
trial period............................................................................................2
crypkey.h..................................................................92, 179, 181, 202, 240
CrypkeyVersion().............................................................................160, 174
cui.exe.................................................................................................... 106
D
DAL........................................................................................................... 78
days license.............................................................................................. 61
defragmentation programs.....................................................................144
disk compression....................................................................................144
distributors, authorizing...........................................................................80
E
EndCrypkey()....................................90, 127, 160, 178, 198, 208, 230, 251
Example.exe............................................................................................. 51
ExplainErr2()...................................................................................180, 182
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
external links
security............................................................................................. 107
using binary files...............................................................................106
F
features................................................................................................1, 17
floating license
defined.............................................................................................. 260
specifying.......................................................................................... 130
FloatingLicenseSnapshot().............................................................181, 183
floppy transfer........................................................................................135
functions................................................................................................. 159
G
Get1RestInfo()........................................................................160, 185, 186
GetAuthorization()....88, 89, 127, 130, 160, 171, 173, 180, 181, 187, 204,
205, 227, 229
GetDrivePermanentSerialData().....................................................181, 196
GetNumCopies().............................................................................161, 199
GetNumMultiUsers().......................................................................161, 199
GetSiteCode2()...............................................................................161, 205
guarantee................................................................................................. 16
H
hacking................................................................................................... 125
hard drives
failure................................................................................................ 144
removable......................................................................................... 147
I
information transfer........................................................................107, 108
InitCrypkey().....88, 89, 127, 161, 171, 173, 180, 181, 194, 195, 206, 261,
262
installer software....................................................................................148
installing
32-bit thunk library.............................................................................48
CrypKey SDK.......................................................................................24
MS-DOS network driver.......................................................................44
network driver...................................................................................130
Novell NetWare...................................................................................45
Windows 95 network driver.................................................................43
Windows NT driver..............................................................................43
Internet distribution................................................................................147
K
keys............................................................................................................ 3
master............................................................................................... 3, 9
obtaining............................................................................................. 10
site............................................................................................3, 10, 11
temporary........................................................................................... 11
B AT T L E - P R OV E N S O FT WA R E P R O T E C T I O N & L I C E N S E S E C U R I T Y
user................................................................................................... 3, 9
KillLicense()....................................................................161, 180, 181, 213
L
levels..................................................................................59, 60, 194, 261
libraries
linking................................................................................................. 93
third party......................................................................................... 144
licenses
changing............................................................................................. 76
defined........................................................................................17, 261
establishing......................................................................................... 88
floating.............................................................................................. 145
limiting................................................................................................ 61
moving.............................................................................................. 135
preventing loss.................................................................................157
transferring...............................................................................136, 143
M
Master Key......................................................................................3, 9, 261
MS-DOS
network driver.....................................................................................44
program.............................................................................................. 57
multiple program names........................................................................145
N
network licensing....................................................................................130
Novell NetWare......................................................................................... 45
O
options................................................................................59, 60, 194, 261
P
packing list............................................................................................... 40
password
number.......................................................................................10, 261
temporary (for development)..............................................................11
R
readme..................................................................................................... 41
readme!.hlp.............................................................................................. 40
ReadyToTryDays()...........................................................................161, 222
ReadyToTryRuns()............................................................................161, 223
releases.................................................................................................. 145
run modes
silent................................................................................................. 111
verbose............................................................................................. 111
runs license.............................................................................................. 61
S
SaveSiteKey()...........................................89, 162, 180, 181, 187, 227, 229
setupex.exe....................................................................................110, 131
setupex.xco............................................................................................ 110
site.......................................................................................................... 261
obtaining............................................................................................. 11
transferring......................................................................................... 17
site key......................................................................................... 3, 10, 262
creating............................................................................................... 11
transferring......................................................................................... 17
Site Key Generator
defined................................................................................................ 59
software protection.................................................................................139
Stealth directory.................................................................................42, 43
StealthPlusTM...................................................................................11523
support............................................................................................... 8, 143
supported platforms...............................................................................131
system requirements..................................................................................7
T
tampering............................................................................................... 125
telephone authorization.........................................................................142
testapp.exe............................................................................................... 51
thunk library............................................................................................. 48
trial period..................................................................................................2
U
unlimited license......................................................................................61
updates................................................................................................... 145
User Key.......................................................................................... 3, 9, 262
V
verbose mode......................................................................................... 111
W
Watcom................................................................................................... 144
wckserve.exe....................................................................................43, 131
Windows NT
driver installation program...............................................................109
supported versions...........................................................................113
uninstalling driver.............................................................................112
Windows NT drivers..................................................................................43
Windows program
authorizing....................................................................................51, 52