|
|||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
Download axiomatictokenizer_attach.zip - 188 KB
Contents
ScreenshotsMain screenshot:
"Make payment" / keyboard screenshot:
Source code licenseDeveloped by the AxiomaticId Entity (www.axiomaticid.org). Released under a "Common Sense License" / "Public Domain License". Original author: George Gabriel Hara (www.gardenerofthoughts.org). Original SHA256 code by Angel Marin, Paul Johnston (anmar.eu.org/projects/jssha2), released under a BSD license. Original BigInteger code by Tom Wu (www-cs-students.stanford.edu/~tjw/jsbn), released under a BSD license.
IntroductionThis article presents a mechanism to dramatically increase the security of online financial services, like digital currency services and banks, by separating the user authentication from the Internet and by authenticating every action chosen by the user. The article also presents certain techniques which improve the quality of JavaScript / HTML applications, like portability, color scheming, translation and wizard-like user interface. The implementation, AxiomaticTokenizer, is an open source
application developed in HTML and JavaScript, specifically designed
for mobile devices (like PDAs).
BackgroundThe security of online payments is today under heavy attack and
things are only getting worse as more and more people start making
payments over the Internet. Threats like spyware and phishing destroy
user confidence in online services who are expected to "do
something".
Who should use it?Password-based security is extremely simple, so why would a user trade this simplicity for token-based security which require some effort to type the tokens? Users who only have several hundreds dollars worth of digital currency in their accounts, have no reason to do this. However, the necessity to protect large amounts of digital currency, starting from (tens of) thousands of dollars worth of digital currency, motivates users enough to deal with token-based security.
FeaturesMulti-service support. Multi-currency support. Support for service partners. Support for sponsored entities. Support for payment delay. Support for inheritors. Support for group authentication. Support for payment arbitration. Support for subscriptions (/ repeated payments). The payment history can be hidden from all users. Actions specific for online payment services. Asymmetric encryption (RSA) for sending the shared secret (derived from the user's passphrase) to the service. Customizable token hash field size. This is meant to reduce the amount of characters which users need to type. Optional spy protection for tokens. The disadvantage of this protection is that it increases significantly the size of the tokens. Account name checksums meant to ensure that if the user types the wrong account name, he is warned about it. Users should publish their account names together with their checksums, like this "Alice/65". Private account names. By simply adding "#" at the end of an account name, the account name sent to the service is actually a mix of the written account name and of the service's name, in a way which effectively hides the written account name from the service. Color themes. Multi-language support. Table with mappings between two dice and characters. This is meant to help users to generate truly random passphrases. Multi-platform: Firefox, InternetExplorer, InternetExplorer Mobile, Opera, Opera Mobile, Safari. Easy to check HTML and JavaScript open source code.
Payment token exampleAT1; MTM; MP; 20080701052542; aliceakula.stash; bobbonkers.pub; NA; AUG; 10; 3E2 485 C96 22D DDF 8;
Service partnersService partners are entities which bring users to a service, and they receive a fraction of the payment fee charged by the service from these users. Service partners help a service grow faster. When you create an account with a service, you have the possibility to specify the account name of the service partner which recommended the service to you. If you do specify the account name of a service partner when you create an account, you will be charged a smaller fee for every payment you make from that account. Here is an example of how the payment fee could be split. The payment fee is 1% from the amount of paid digital currency. The following percentages are from the fee:
Only the entities chosen by the service may be service partners. This is so that the users, in general, could not be service partners for their own accounts.
Sponsored entitiesWhen you create an account with a service, you have the possibility to specify the account name of an entity which you want to sponsor. Every time you make a payment, the sponsored entity (automatically) receives a fraction of the fee which is charged from you by the service. If your account has no sponsored entity, the service gets the entire payment fee. Only the entities chosen by the service may be sponsored entities. This is so that the users, in general, could not be sponsored entities for their own accounts.
Payment delayIf you have an account whose name you make public, in order to enhance its security, all payments made from the account can in fact be made some time after you request the service to make them. This way, the account acts like a vault with a timed door, door which, for example, can't physically be opened during the night. For security reasons, once the payment delay is set, it can only be increased (not decreased).
InheritorsA user account may have inheritors. This is a feature which lets users specify to the service to automatically move all the digital currency from their accounts to the inheritor accounts, in case they become unable to access their own accounts. Let's consider that Alice, who has an account with the service, dies or becomes permanently incapacitated to access her account. Without inheritor accounts, it would be very difficult for Bob, her husband, and Claudia, her daughter, to receive the inherited digital currency. But if Bob and Claudia have an account with the same service, Alice can add Bob's and Claudia's accounts as inheritor accounts for her own account. If, during a period of (for example) one year (the actual value is set when an account is created), Alice doesn't send any valid token to the service, her account would enter in inheritance mode, that is, all the digital currency from her account would be automatically moved to the inheritor accounts, Bob's and Claudia's account. The way the digital currency is split depends on how many inheritance shares Alice allocated for each inheritor. The number of inheritance shares is specified when Alice adds an inheritor to her account. The digital currency is divided for each inheritor as a fraction equal with the number of inheritance shares allocated for the inheritor divided by the total number of inheritance shares allocated for all inheritors of that account. For example, if Bob has B inheritance shares, and Claudia has C inheritance shares, Bob receives a fraction equal with "B / (B + C)" from the digital currency in Alice's account, and Claudia receives a fraction equal with "C / (B + C)".
Cascading inheritanceThe automatic movement of the inherited digital currency from an account to the inheritor accounts has an interesting side effect: cascading inheritance. Let's say that Alice has Bob as inheritor, and Bob has Claudia as inheritor. If at some point both Alice and Bob become unable to access their accounts, Claudia will receive the digital currency from both of them, of course when each account enters into inheritance mode.
ArbitersWhenever you want to make a payment in order to buy something, you can use an arbiter to intermediate the transfer of digital currency. To do this, simply type the account name of the arbiter in the "Arbiter account name" edit-box from the "Make payment" page, in AxiomaticTokenizer. When you send the generated token to the service, the digital currency is taken out of your account and put in a queue which contains all arbitrated payments, from all users. At this point the digital currency is still owned by you, but is under the sole control of the service, and under contract that it will be sent to the account chosen by the arbiter. The arbiter can decide to either send the digital currency back to you or to send it to the recipient of the payment. The arbiter can not (physically) do anything else with the digital currency, like disappear with it (unless the arbiter and the recipient of your payment are the same entity). Note that if you use an arbiter, you may be charged an additional payment fee (the maximum fee depends on each service).
SubscriptionsSometimes you may want to subscribe to a service, or purchase something in installments, and have the periodic payments automatically made. You can use the "Setup subscription" action to setup a payment which will be made to same account name, for a specified amount of currency, for a number of times. The first payment is made when you setup the subscription, then repeatedly after the timeframe specified there elapses.
Group authenticationGroup authentication can be used by organizations to ensure that access to an account is possible only if a minimum number of members of the organization agree to execute the same action. For example, an organization might have an account with a payment service where it keeps (some of) its money. The organization would not want any single member to have full access to this account, but rather ensure that all payment requests are executed only if at least 3 (out of 5) members of the organization agree on the payment. When group authentication is used to execute an action, all members who generate tokens must type the same information in AxiomaticTokenizer (except, of course, their own passphrase). Then, they must send their tokens using a form (provided by the service) similar to the token submit form included in the attached archive. The service checks if all tokens are valid for that account and ensures that all information from the tokens is the same, except for the time seed and for the token integrity hash. If all this is correct, the action is executed. Two members of a group can't have the same passphrase or shared secret. For security reasons, once an account is created, group authentication can't be changed. This is because the tokens which would form the action to change this setting can be replaced on their way to the service, thusly making it virtually impossible to be certain in advance who would control the account after this setting is changed. It is possible to be sure of this, but the necessary management would be too complex for users. Although this could also happen when the account is created, the account doesn't contain any digital currency at that point so it can be abandoned unless all group members receive back from the service their execution success proof. All actions, except "Change passphrase" and "Login account", are affected. The token submission form of a service (which has support for group authentication) must provide a way to show enough edit-boxes where the tokens of the members of the user organization may be typed. When an account is created, the number of tokens typed in the token submission form must be equal with the total number of members of the group, number specified in the "Create account" token (of each member). In the case of all other actions (affected by group authentication), the number of tokens must be equal with the required number of present members; otherwise, the action is not executed.
SubtletyIt's very important that an action to be executed is authenticated by the exact required number of present members, not by more. Consider that an account has group group authentication set to "3 / 9" (3 out of 9). If a payment is being authenticated and all 9 members generate tokens for the payment request, an attacker who could intercept the token submit form could split the 9 tokens in 3 parts, and then send them to the service as separate payment requests. Since the tokens don't have a way to identify that they refer to the same unique action, the service can't tell that all 3 parts do in fact refer to the same unique payment and it would execute execute all 3 payments. The token time seed could be used as a way to identify the same unique action for any number of tokens, however that would require that all group members synchronize it so that the service could mandate that it too be the same for all the tokens of the group sent in the same token submit form.
Show payment historyPeople will always need a public account where to receive digital currency, but they also need an account which can be hidden from anyone else; "hidden" doesn't mean hidden from the service, but from other people. The problem is how to transfer currency from the public account to the hidden account, without other people ever knowing of the transfer. This is solved, by the service, by not keeping the history for all the payments into and out of the public account. In order allow this, AxiomaticTokenizer lets users specify whether to keep or not the history of all the payments for an account. For security reasons, this can be only specified when an account is created, or changed later from "Yes" to "No" (never from "No" to "Yes"). Even if the user chooses to not keep the history of the payments, the service may still keep it internally, but it's guaranteed that no other user will see it. This feature isn't useful for organizations who need to keep track of the payments they receive and make, but they can use delayed payments and group authentication anyway. Individuals may find this feature to be the only one to protect them from criminals who would want to see what currency they have in their accounts, how much currency has entered into the accounts and to what accounts was the currency moved.
Typical integrationAxiomaticTokenizer is only the client side, the user interface. An online payment service has to implement the server side, that is, code which parses the incoming tokens and executes the requested actions in the database. You must implement the following tokens in your system:
All other tokens are optional.
The following information is required for a service to be integrated in AxiomaticTokenizer:
Here are the available service actions: Create account, Change passphrase, Change service partner, Change sponsored entity, Change payment delay, Change inheritance trigger timeframe, Change show payment history, Add inheritor, Remove inheritor, Login account, Make payment, Setup subscription. The "Generate account locator" service action is automatically added for all services. Here are the available currency names: Gold gram (AUG), Gold ounce (AUO), Silver gram (AGG), Silver ounce (AGO), Australian Dollar (AUD), British Pound (GBP), Canadian Dollar (CAD), Chinese Yuan (CNY), Euro (EUR), Japanese Yen (JPY), New Zealand Dollar (NZD), Swiss Franc (CHF), US Dollar (USD). Other currency names can be added.
Custom settingsYou may want to give to your users the possibility to download and use the original AxiomaticTokenizer, but with some customized internal values, like the default language and color scheme. Since you can't change AxiomaticTokenizer, you can only change its file name. The file name may contain custom settings in the form "name=value", all separated by "_" (including the first one). Some custom settings may be lists, in which case the items of the list are separated by ",". AxiomaticTokenizer parses the name of the file form where it is started and changes some internal values to match those specified. Here is the list of possible custom settings:
If a custom setting is not specified, the internal default value is used. Here is an example of a file name which contains custom settings: "axiomatictokenizer _ clr=paleblue _ lng=ro _ vsn=MetalMoney, FiatMoney.htm" (ignore the blank spaces). When AxiomaticTokenizer is started from a file with this name, the initial color scheme is pale-blue, the initial language is Romanian, and the visible service names are only "MetalMoney" and "FiatMoney".
Adding a serviceYou can easily add a new service to AxiomaticTokenizer. Open the source code in a text editor and search for the following text: "var ServiceInfos". This variable is an array which contains the information for all supported services. Copy one of the existing service elements, as a new service element, and change its information, particularly:
ArchitectureOne-time tokens are like one-time passwords. They can be used to secure data only one time. After they are used, they must be discarded, else they could be used to perform the same action again. The difference between one-time tokens and one-time passwords is that a token cryptographically secures the data which has to be sent from the client / user to the server / service (where it's to be used), whereas a password is simply used for comparison. Basically, a token is generated from the data which has to be sent to the service (like the account name of the user, the account name of the recipient of the payment, the amount of currency to be paid), some dynamic data (like the current time) which makes the token different every time, and a secret, called shared secret, which is known to both the user and the service. The shared secret is sent only once to the service, when the user creates his account, not every time an action has to be performed (like for passwords). The token contains the plain data which the service has to know in order to re-create the token on its own, and a hash of this data. If the user token and the service token are the same, it means that the shared secret which was used by the user to generate his token is the same as the shared secret from the user's account. Thusly, the user and his action are authenticated and the payment is executed. Tokens authenticate every action made by the owner of the account, instead of just the login (as is with passwords).
Data fillingThe letter case (for names and passphrases) is insensitive everywhere. During comparisons and hashing, all text is converted to upper case. All texts are encoded in ASCII-7. A token is formed by several fields, each two being separated by a token field separator: ";". A token always ends with a token field separator. This separator is not included in any data to hash. Long texts are always displayed in motes of 3 characters with a mote separator (= a blank space) among them. This separator is not included in any data to hash.
Time seedA time seed is formed from the following concatenated textual time information, represented in UTC coordinates:
The time seed of the last successfully executed token must be stored, for each account, by the service in order to know that the future tokens with a time seed smaller or equal with it are not to be executed. In the case of group authentication, the stored time seed is the biggest one from all the tokens received in the same token submit form.
Shared secret generationA shared secret is the textual representation (in base 16) of a passphrase blender. The passphrase blender version "1" applies the SHA256 hash 20 times iteratively (= over the previous binary hash), of the following concatenated information:
This algorithm allows the user to use the same passphrase for all services because the shared secret is different for each of them (and no service can retrieve the user's passphrase).
Account locator generationAn account locator is the textual representation (in base 16) of an account name blender. The account name blender version "1" takes the first 8 bytes of the SHA256 hash of the following concatenated information:
This algorithm allows the user to use the same account name for all services, without the two services being able to link the accounts to the same user, because the account locator is different for each of them.
Execution proofsThe execution proofs are automatically generated, and displayed to the user, for all tokens. An execution proof version "AT1" is the textual representation (in base 16) of the first 8 bytes of the SHA256 hash of the following concatenated information (of the token):
The service must always compute and include an execution proof in the response sent to the user, except when the time seed of the processed token is smaller or equal with the time seed of the last successfully executed token. The execution success proof must be sent only if the requested action was successfully executed. The execution error proof must be sent only if an error occurred while executing the requested action. It must not be sent if the token is queued for later execution, or is malformed, or if the time seed of the token is smaller or equal with the time seed of the last successfully executed token.
Reference code formatIf you need to quickly locate a token long after it is generated, keep the token reference code, if one is displayed by AxiomaticTokenizer.
Payment reference codeA payment reference code is displayed for all generated "Make payment" tokens. A payment reference code has the same version as the associated token. A payment reference code version "AT1" is the textual representation (in base 16) of the first 8 bytes of the SHA256 hash of the following concatenated information (of the token):
Subscription reference codeA subscription reference code is displayed for all generated "Setup subscription" tokens. A subscription reference code has the same version as the associated token. A subscription reference code version "AT1" is the textual representation (in base 16) of the first 8 bytes of the SHA256 hash of the following concatenated information (of the token):
Token formatAxiomaticTokenizer implements tokens specifically to be used for a payment service. A token is formed by several fields, each two being separated by a token field separator: ";". This is not included in the data to hash. A token may contain white spaces. These must be removed before the token is processed.
Payment token exampleAT1; MTM; MP; 20080701052542; aliceakula.stash; bobbonkers.pub; NA; AUG; 10; 3E2 485 C96 22D DDF 8;
Create accountFields:
This token is always asymmetrically encrypted with the service's public key.
Change passphraseFields:
This token is always asymmetrically encrypted with the service's public key.
Change service partnerFields:
This token may be unencrypted.
Change sponsored entityFields:
This token may be unencrypted.
Change payment delayFields:
This token may be unencrypted.
Change inheritance trigger timeframeFields:
This token may be unencrypted.
Change show payment historyFields:
This token may be unencrypted.
Add inheritorFields:
This token may be unencrypted. See Inheritors for details.
Remove inheritorFields:
This token may be unencrypted. See Inheritors for details.
Login accountFields:
This token may be unencrypted.
Make paymentFields:
This token may be unencrypted.
Setup subscriptionFields:
This token may be unencrypted. See Subscriptions for details.
Encrypted tokensTokens may be asymmetrically encrypted with the public RSA key, included in AxiomaticTokenizer, of the service where the token is to be sent. The padding is PKCS#1 v1.5. Encrypted tokens may be sent through unencrypted communication channels, without revealing their content. The tokens for creating an account and for changing the account's passphrase are (and must) always be encrypted. All other tokens may be unencrypted (although they can also be encrypted), and this is preferred for the following reasons:
An encrypted token has the following fields (separated by the token field separator):
A service must expect to receive a token either encrypted or unencrypted. A token is encrypted if it has exactly 4 fields; the third field is the service's public key identifier.
Execution proofTwo texts called "execution success proof" and "execution error proof" are associated to all tokens. They are automatically generated by AxiomaticTokenizer, in a unique way, from all the token fields (which are hashed to generate the token integrity hash), and displayed to the user. Without the execution success proof, the account creation phase would be exposed to potential MITM (= Man-In-The-Middle) attacks, if the attacker could intercept all the Internet traffic of the user who wants to create an account. To do this, the attacker would have to intercept the original "Create account" token and not forward it to the service. As such, the service would not have an account with the name specified in the token, and so nobody could make payments to it. Later, when the user would try to access his account, he would likely do it with an unencrypted token, token which would expose the account's name. At this point the attacker would intercept the user's token and send to the service a (shadow) token in order to create the account with the name specified by the user, but with a shared secret known by the attacker. From this moment on, the attacker would in fact own the account with that name, without anyone's knowledge. At least until he could no longer replace the user's tokens with his own (shadow) tokens, like when the user would use another computer to connect to the Internet. To prevent this, the execution success proof is automatically computed for the "Create account" token, and after the account is created it is displayed to the user in the response sent by the service. Since the "Create account" token is encrypted and only the service can decrypt it, nobody else can compute the execution success proof. So, if the execution success proof received back by the user is the one displayed by AxiomaticTokenizer, the user can be sure that his token was indeed processed by the service, and that the account with the name chosen by him is accessible only with his shared secret. All the other types of tokens are intrinsically secure against MITM attacks, so for them the execution success proof provides only assurance that the token was executed by the service and it wasn't stopped on its way by an attacker (who then sent back to the user a response that the token was executed by the service). Similarly, the execution error proof only provides assurance that the service reports that the token was not executed, and that it wasn't stopped on its way by an attacker (who then sent back to the user a response that the token was not executed by the service, although it could have been executed if it were let to reach the service).
Weaknesses
Passphrase strengthThe security of all tokens depends on how strong the user's passphrase is and on whether a thief can intercept an unencrypted token. If the passphrase is weak, like a single word, a thief who can intercept a token can use all the known data to initiate a dictionary attack until he finds that a certain passphrase generates the token. Due to the fact that AxiomaticTokenizer is written in JavaScript and because iterative hashes written in JavaScript are thousands of times slower than iterative hashes written in native code (C), very few hash iterations are used when the shared secret is generated from the user's passphrase. This makes a dictionary attack much easier. The best choice here is for the user to use a strong passphrase, as is specified in the documentation of AxiomaticTokenizer, made from a memorized part and a written part. Of course, someone might easily get the written part of the passphrase, but this is virtually impossible to do remotely. The memorized part makes the written part useless on its own.
DatabaseThe service's database is another potential weakness. The service must store the shared secrets as they are given by the users. It's not possible to hash them as passwords are hashed because the shared secret is not sent by the user every time he requests an action to be executed. This means that a thief who has access to the (decrypted) database can steal all the digital currency from all accounts, but clearly this is the last problem the service has.
Integration tipsService partners and sponsored entitiesThe implementation of service partners and sponsored entities must not hamper the distributive capabilities of the database. For this to happen, the fees for the service partners must not be added to their accounts at the same time the payments are made. Instead, they must be added to a special table and consolidated only once a day / week, either automatically or manually by the service partners.
User privacyIn order to protect the privacy of the users, the service partners and sponsored entities must not know what users have added them to their accounts, and how much and who do they pay.
Token timeFor increased safety, a service should consider invalid a token whose time seed is smaller with more than 7 days than the current (service) time, or bigger with more than 1 minute (just in case the clocks are desynchronized).
Multiple token executionThere is no need to verify the entire history of tokens in order to ensure that a token is executed only one time, so long as the time seed of the token is verified to be bigger (not equal) than the time seed of the last successfully executed token (time seed which is stored for each account).
RsaKeyGenYou can use RsaKeyGen (included in the attached archive) to generate RSA keys and encrypt and decrypt data. You can also look at the source code to see how to decrypt the encrypted tokens using C#: RSACryptoServiceProvider rsa = FromRsaKeyParams(); string textToDecrypt = TextToDecryptTextBox.Text; byte[] data = TextUtil.HexTextToArray( textToDecrypt ); byte[] decrypted = rsa.Decrypt( data, false ); // The (decrypted) token. TextToEncryptTextBox.Text = Encoding.UTF8.GetString( decrypted );
The private RSACryptoServiceProvider FromRsaKeyParams() { RSAParameters rsap = new RSAParameters(); rsap.Exponent = TextUtil.HexTextToArray( RsaKeyParamETextBox.Text ); rsap.Modulus = TextUtil.HexTextToArray( RsaKeyParamMTextBox.Text ); rsap.D = TextUtil.HexTextToArray( RsaKeyParamDTextBox.Text ); rsap.DP = TextUtil.HexTextToArray( RsaKeyParamDPTextBox.Text ); rsap.DQ = TextUtil.HexTextToArray( RsaKeyParamDQTextBox.Text ); rsap.P = TextUtil.HexTextToArray( RsaKeyParamPTextBox.Text ); rsap.Q = TextUtil.HexTextToArray( RsaKeyParamQTextBox.Text ); rsap.InverseQ = TextUtil.HexTextToArray( RsaKeyParamQITextBox.Text ); RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)RSACryptoServiceProvider.Create(); rsa.ImportParameters( rsap ); return rsa; }
Verify encrypted tokensIf you want to see an unencrypted token which was encrypted by AxiomaticTokenizer, first use the "Generate RSA key" function from RsaKeyGen to generate an RSA key. Copy the "M" key parameter into AxiomaticTokenizer, as the public key of the service for which you generate the token, for example as the value of the "MetalMoney_RsaPublicKeyM" variable. There is no need to set the "E" key parameter, the default value is the same for both applications. Generate an encrypted token for the service. Copy the token, just the token field which contains the encrypted data (= the longest one), and paste it in the "To decrypt" text-box from RsaKeyGen. The white spaces are irrelevant. Click the "RSA decrypt" button, in RsaKeyGen. In the "To encrypt" text-box, you can see the unencrypted token.
Token submit formServices can use the token submit form included in the attached archive, where users can type their generated tokens. You need to customize it to fit your specific requirements. Although this form can be made to work offline so that the users could simply type tokens in it, this would mean lost flexibility for service providers.
The source codeWhile you analyze the code, you may realize that you know or you may see a better way to code a certain feature. But you have to consider that the target platform for running the code is the world of mobile browsers, that is, the application must run on PDAs, and therefore your way of doing things is likely unusable. Another requirement for the target platform is a touch screen. This requirement affects the design of the user interface such as to make it possible to use the fingers as much as possible. If AxiomaticTokenizer would be written in a high level language, like C#, not in a scripting language, like JavaScript, the programming mechanisms would be different. In the case of JavaScript, the entire program is contained in a single file in order to make its download easy. Various other programming mechanisms are simplified due to this constrain and due to the fact that JavaScript is not type safe. For example, classes are used on a small scale; of course, the small size of AxiomaticTokenizer makes it easy to use global declarations.
Code commentsAll combo-box items must contain a textual value which is neither null nor empty. The display text of each item can't be either null or empty. The "WipeSensitiveData" function is used to overwrite any sensitive data found in the RAM (as unallocated variables). Basically, a large buffer is allocated (and deallocated) in order to overwrite garbage collected variables.
Browser detectionDetecting the browser on which a JavaScript application runs is one tough cookie. Many Internet browsers want to fool the visited websites into thinking that another kind of browser is requesting the HTML pages. Here is the code: // Gets the name of the host application, in uppercase. function GetHostAppName() { var appName = navigator.appName; appName = (appName != null) ? appName.toUpperCase() : ""; var userAgent = navigator.userAgent; userAgent = (userAgent != null) ? userAgent.toUpperCase() : ""; if( userAgent.lastIndexOf( "Opera".toUpperCase() ) >= 0 ) { // Check this before InternetExplorer because OperaMobile also contains // the string "Internet Explorer". if( userAgent.lastIndexOf( "PPC".toUpperCase() ) >= 0 ) return "OperaMobile".toUpperCase(); else return "Opera".toUpperCase(); } else if( appName == "Microsoft Internet Explorer".toUpperCase() ) return "InternetExplorer".toUpperCase(); else if( appName == "Microsoft IE Mobile".toUpperCase() ) return "InternetExplorerMobile".toUpperCase(); else if( userAgent.lastIndexOf( "Safari".toUpperCase() ) >= 0 ) return "Safari".toUpperCase(); else if( userAgent.lastIndexOf( "Mozilla".toUpperCase() ) >= 0 ) { // This has to be checked last because many Internet browsers contain it. return "Mozilla".toUpperCase(); } else return ""; // Unknown host application. } Then, we simply need to check the text returned by this function: function IsBrowserInternetExplorer()
{
return GetHostAppName() == "InternetExplorer".toUpperCase();
}
PortabilityThe coding in general, and the user interface in particular, had to be adjusted to provide access to the mobile platforms. For example, color scheming could be done by dynamically changing
the style sheets (using the Implementation subtleties for the HTML and JavaScript hosts make debugging difficult at times. For instance, on Internet Explorer Mobile 6, trying to display or set a display text with a null object causes an exception, but works in the other Internet browsers. Another example is, also on Internet Explorer Mobile 6, that a comma at the end of an array's items generates a null item, but no item in the other browsers. Interestingly, despite the large size AxiomaticTokenizer, the mobile browsers load it and work well with it (although significantly slower than on the desktop editions of the browsers). One worry that I had was the speed of the big integer library on mobile devices. Although the performance of RSA encryption isn't anywhere near to that of a desktop browser, it's acceptable. For example, generating an encrypted token on a mobile browser, on a mobile device with a 400 MHz microprocessor, takes about 10 seconds.
Color schemingThe best way to implement color scheming is to do it without changing the colors of each visual HTML element, and also without specifying an array with all the HTML elements which need to have a color scheme (because this would need to be updated as the HTML elements from the page are added or deleted). Color scheming is implemented using a CSS feature: multiple class
names for any HTML element, like From this point on, all we need to do is change the class name of
the color scheme, that is, simply replace var colorSchemeName = colorSchemeNameArg.toUpperCase(); var prevColorSchemeName = FindPreviousColorSchemeName( className ); className = className.toUpperCase(); if( (prevColorSchemeName != null) && (prevColorSchemeName != "") ) { prevColorSchemeName = prevColorSchemeName.toUpperCase(); // Change the widget's CSS class. if( className.indexOf( prevColorSchemeName ) >= 0 ) widget.className = className.replace( prevColorSchemeName, colorSchemeName ); }
To change the color scheme of all HTML elements we need to iterate
through all the HTML elements from a page, using the var i = 0; while( true ) { var widget = document.all[ i ]; if( widget == null ) return; // Do stuff. i++; }
Note that
Wizard-like user interfaceA wizard-like user interface is the easiest for the users to work with. At the same time, it is also the most difficult to develop. Due to the fact that Axiomatictokenizer is specifically designed for mobile devices, not desktop computers, a wizard-like user interface fits best in the small space of the display of such a device. Since the entire user interface is contained in a
single file, all HTML elements would be visible when the application
were started, unless they are specifically hidden: The only HTML elements which must be visible when
the application starts are the frame ( From the moment the application starts, HTML elements are displayed only programmatically, organized on pages. Except for the first page, the welcome page, all other pages are displayed when the user clicks on a button (or otherwise interacts with the HTML elements). The pages which are part of a wizard which collects the data to be used for generating tokens, display a single editable HTML element in order to guide the user step by step through the process of filling in the data required to generate a token. Since Axiomatictokenizer is a simple application, only two global buttons are present on a wizard's page, one to move to the next wizard step, and one to abort the current wizard (and go back to the main menu). A wizard is started by calling a method
(
TranslationTranslation is very useful for a global application, particularly for an application whose target is the masses, not advanced computer users who generally know English. Because Axiomatictokenizer is a simple application, the translation is entirely done when the application starts or when the user changes the current language, not when a page is displayed. Before anything, we need to setup the resources
which contain the translated texts, in this case the Just like in the case of color schemes, in order to
translate the user interface, we need to iterate through all the HTML
elements, using the var langId = document.all[ "LanguageNameComboBox" ].value; SetCookie( LangIdCookieName, langId ); SetLocalizedGui( langId ); // Localize the header of the welcome page because its text is dynamically set, and it // is on the same page where the language is changed. document.all[ "PageHeaderRow" ].innerHTML = FindCurrentLocalizedText( "Welcome", null ); // Localize the "Choose service name" item because the widget which contains it is // dynamically filled, and it is on the same page where the language is changed. UpdateComboBoxByIdItem( "ServiceNameComboBox", GenericItemValue_Choose , FindCurrentLocalizedText( "ChooseServiceNameItem", null ) ); // Localize the service actions because the widget which contains them is // dynamically filled, and it is on the same page where the language is changed. ShowServiceAction();
However, sometimes it may be necessary to manually set the display
text of an HTML element, like when the content of a combo-box is
programmatically populated. In such a case, we need to call the
document.all[ "PageHeaderRow" ].innerHTML = FindCurrentLocalizedText( "Welcome", null ); Here is how manual translation with formatting data is done: var extractedChecksum = GetAccountNameChecksum( accountNameArg ); var accountName = BlendAccountName( accountNameArg, serviceNameArg ); var computedChecksum = ComputeAccountNameChecksum( accountName.toUpperCase() ); if( extractedChecksum.toUpperCase() == computedChecksum.toUpperCase() ) return null; else return FindCurrentLocalizedText( "InvalidAccountNameChecksum" , [ extractedChecksum, computedChecksum ] );
Known issuesOpera 9.24 and Opera Mobile 8.65 don't visually update the combo-box items which are automatically selected. Opera 9.5 doesn't have this problem. Firefox sometimes doesn't activate the function to copy text (from outside a text-box) to clipboard. If this happens, first select some text from a text-box, then select and copy the text of a token.
In order to properly see the integrated keyboard and the "Dice – character mappings" table on InternetExplorer Mobile, the "Menu \ View \ One column" setting must not be set.
Q&ACan AxiomaticTokenizer be deployed on an existing online payment service? Yes. It's a generic system. However, this is only the client side, the user interface. An online payment service has to implement the server side, that is, code which parses the incoming tokens and executes the requested actions in the database.
May I put a "Make payment" token in the purchase form of a shopping website? Yes, if the passphrase of the account from which you pay was chosen as recommended in the documentation of AxiomaticTokenizer.
I have seen some proxy websites which send tokens to the service, to help mitigate DDOS attacks. May I send a token through such a proxy? Yes, if the passphrase of the account from which you pay was chosen as recommended in the documentation of AxiomaticTokenizer.
I am not sure that my last payment was actually made. Can I generate a new token with the same payment information? No! Just resend the same token until you receive an execution proof from the service (but don't try too many times because the service doesn't send an execution proof when the time seed of the token is smaller or equal with the time seed of the last successfully executed token). If you receive the execution error proof, it's guaranteed that the payment was not executed. DO NOT generate another token with the same payment information unless you want to make a new payment.
For some reason, a token which I generated an hour ago didn't reach the service; or it might have, but I am not sure. How can I ensure that it's ignored if it eventually reaches the service? Generate another token (for example, for login) and send it to the service. If this token reaches the service and it's executed, the older token will not be executed if it reaches the service afterwards.
What information is saved by AxiomaticTokenizer in order to later access an account? None. AxiomaticTokenizer is stateless, that is, it requires no saved information in order to access an account. The user must remember or store his account names and passphrases. If a device with AxiomaticTokenizer is lost, all the accounts of its owner can still be accessed with another device. A user may choose to have various account names saved by AxiomaticTokenizer.
There is absolutely no amount of security (provider-based, user-level hardware, etc...) that can overcome the user's willingness to hand over access to a social engineering con artist. The purpose of AxiomaticTokenizer is to offer a technological solution to people who want to protect their money inside the money issuer. What people choose to do with their money is their choice, not for AxiomaticTokenizer to police.
History01.07.2008 – All tokens have a service ID field to help with automatic processing. The token submit form can now automatically select the processing weblink. 31.05.2008 – The Execution proof is usable for all tokens. 27.03.2008 – Sent the article for publication to CodeProject.
| ||||||||||||||||||||||||||||