We will be at OWASP APPSEC EUROPE 2017 - Belfast! Let’s talk!MORE INFO

Help Center

Get to know more about our API, Code Annotations and Code Transformations

Date Lock

Potency
3 / 3
Resilience
3 / 5
Cost
2 / 5

Tags: date,lock,code

Description

Date Lock locks the code to a period of time. There are three ways to lock your
code to a period of time:

  • Lock the code to only allow execution after a specific date (known as startDate)
  • Lock the code to expire after a specific date (known as endDate)
  • Lock the code to only allow execution between two dates (startDate and endDate)

This is a good transformation to enforce license agreements. A warning function
can be specified (optionally) to be executed when the code runs in an invalid
period of time. The warning function is implemented by you and can be used, for
instance, to send a report to your server or to pop up a message.

Consider combining this transformation with obfuscation transformations to harden
the resulting code making it more resilient to automated de-obfuscator tools and
harder to understand by a human. You may also find useful to combine this transformation
with other locks:

Option Types

Name Required Default Value Description
startDate Yes N/A The code won’t run in a date that is previous to the startDate.
endDate Yes N/A The code won’t run in a date after the endDate.
warningFunction No N/A Name of the function that is called when the code is executed in an invalid date.

API Parameters

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"keys": {
"accessKey": "XXXXXX",
"secretKey": "YYYYYY"
},
"applicationId": "ZZZZZZ",
"params": [
{
"name": "dateLock",
"options": {
"startDate": "2016-06-01",
"endDate": "2016-06-01",
"warningFunction": "VALUE"
}
}
]
}