• No results found

Client-side encryption

N/A
N/A
Protected

Academic year: 2021

Share "Client-side encryption"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

Client-side

encryption

(2)

Client-side encryption Page 2

Contents

Client-side encryption 3

How does it work? 3

Integration methods 3

Fast implementation, minimal PCI requirements 4 Where can I find my public key? 4 Is client-side encryption secure? 4

Key features 4

Completing payment support including 3D Secure 5

Integration examples 5 Identify your form with an ‘ID’ attribute 5 Input fields 5 Generationtime field 5 The Javascript 5 Changing form post behaviour using AJAX 5 Integration example server side 6 Submit a charge 6 Submit initial charge and store customer 6 List recurring details/cards for customer 7 Submit a recurring charge 7 Main benefits 8

(3)

Client-side encryption Page 3

Client-side encryption

Barclaycard SmartPay client-side encryption is a P2PE (Point-to-Point Encryption) solution

for Card-Not-Present (CNP) payments which takes the headache out of PCI compliance. With

this solution, you can take credit card payments directly on your own website by encrypting

the card in the browser (client) so that the card data is never visible to your server.

How does it work?

All that is required are the following simple steps. 1. Build your credit card form as you normally would. 2.

Make sure the card fields have the attribute ‘data-encrypted-name’ instead of ‘name’.

3. Include the ‘adyen.encrypt.min.js’ client encryption library. 4. Set the public key and tie the library to your form.

The client encryption library will:

1. intercept the form submission event before it hits your server 2. encrypt the card fields in-browser using a per transaction unique AES key 3. encrypt the unique AES key with your RSA public key 4. send the encrypted data (containing the card and encrypted AES key) with the other fields in the form.

Integration methods:

– full flexibility in look and feel – no card details passing your system – supports all features including 3D Secure – secure and proven solution.

(4)

Client-side encryption Page 4

Fast implementation,

minimal PCI requirements

Key features:

– the Public Key (RSA) can be downloaded from the Barclaycard SmartPay back office – the Secret Key (RSA) is only known to Barclaycard and stored only in encrypted form – all Card data is End-To-End encrypted and is never visible to merchants – the payment authorisation is done over the server-to-server Barclaycard SmartPay API using the encrypted card. – the encrypted data is only valid for a period of 24 hours and tied to your public key. It is of no use outside of this context – uses RSA and ECC in JavaScript: the jsbn library is a fast,

portable implementation of large number mathematics in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers

– uses Stanford Javascript Crypto Library (AES): the Stanford Javascript Crypto Library is a project by the Stanford Computer Security Lab to build a secure, powerful, fast, small, easy-to-use, cross-browser library for cryptography in Javascript.

Where can I find my public key?

The public key is tied to the WebService user you will be submitting the API payment request with. It is available in the back office under ‘Settings’ > ‘Users’ and will be of the form ‘[email protected]’. If no key has been generated yet, you will see an option to ‘Generate’ the key first. It is displayed in ‘pre-formatted’ form so you can simply copy and paste it into your page.

Is client-side encryption secure?

The client-side encryption solution uses only PCI/NIST approved cryptographic algorithms. The RSA key is 2048 bits and unique to your user account. Per transaction the client will generate a unique AES (256bit) key which is used in CCM mode for both encryption and authentication.

(5)

Client-side encryption Page 5

Complete payment support

including 3D Secure

Generationtime field

Add a hidden generationtime field with the current time on server: The format of this should be in the ISO 8601 standard format for XML as YYYY-MM-DDTHH:mm:ss.sssZ, e.g. 2013-04-26T14:02:30.668Z. It is important not to rely on the client’s time (for production) which may be incorrect as the encrypted data is only usable within a 24-hour period of this time. <input type=”hidden” value”= ”GENERATE_ON_SERVER id=”generationtime ” data−encrypted−name=”generationtime” />

The Javascript

<script src=”js/adyen.encrypt.min.js”></script> var form = document.getElementById(’adyen− encrypted−form’); // the form element to encrypt var key = ”10001j80C7821...6BC3458E2788” + ”5 F024B3294....6A2D”; // the public key adyen.encrypt.createEncryptedForm( form, key ); // the form will be encrypted before it is submitted

Changing form post behaviour using AJAx

You can change the behaviour of the library by adding options to the ‘createEncryptedForm()’. For example, change the name of the encrypted data and submit the form using AJAX rather than the default: var name = ’fieldnameofyourchoosing’; adyen.encrypt.createEncryptedForm( form, key { name : name, onsubmit : function(e) { ... Your AJAX Code Here ... e.preventDefault(); } });

Integration examples

A full integration example along with the Javascript lib: https://github.com/adyenpayments/ techevent2013/tree/master/javascript/ clientencryptionjs

Identify your form with an ‘ID’ attribute

<form method=”POST” action=”posthandler. action” id=”adyen−encrypted−form”>

Input fields

Input fields for the card data should have no ‘name’ attribute: <input type=”text” value=”” size=”20” autocomplete=”off” data−encrypted−name =”number” />

(6)

Client-side encryption Page 6

Integration example server side

Here are some examples of how to use the Barclaycard SmartPay client-side encryption API. We use command-line Curl for the sake of simplicity, but the principle remains the same regardless of the tool or programming language used.

Submit a charge

curl --user ‘username:password’ https://pal-test.adyen.com/pal/adapter/httppost \ --data-urlencode ‘action=Payment.authorise’ \ --data-urlencode ‘paymentRequest.amount.currency=EUR’ \ --data-urlencode ‘paymentRequest.amount.value=1234’ \ --data-urlencode ‘paymentRequest.merchantAccount=YourAccountCode’ \ --data-urlencode ‘paymentRequest.reference=Example Order 1’ \ --data-urlencode ‘paymentRequest.additionalData.card.encryptedjson= adyenjs_0_1_1$eGcJxidHkg5LYQ...6LUio9RipqyTBu11MJIC+ rlMYxituYCT7A9yDeF2Rlv2I56KOAap66tTm2uZkto4PKRW4YCA8dZYQ==’

Submit intial charge and store customer

curl --user ‘username:password’ https://pal-test.adyen.com/pal/adapter/httppost \ --data-urlencode ‘action=Payment.authorise’ \ --data-urlencode ‘paymentRequest.amount.currency=EUR’ \ --data-urlencode ‘paymentRequest.amount.value=1234’ \ --data-urlencode ‘paymentRequest.merchantAccount=YourAccountCode’ \ --data-urlencode ‘paymentRequest.reference=Example Order 1’ \ --data-urlencode ‘paymentRequest.recurring.contract=RECURRING’ \ --data-urlencode ‘paymentRequest.shopperReference=user123’ \ --data-urlencode ‘[email protected]’ \ --data-urlencode ‘paymentRequest.additionalData.card.encrypted.json= adyenjs_0_1_1$kj7nlobE1rlC2...iaE/cY878H+Op’ ---Response ----paymentResult.authCode=98356 paymentResult.pspReference=9913642236790892 paymentResult.resultCode=Authorised

(7)

---Client-side encryption Page 7

List recurring details/cards for customer

curl --user ‘username:password’ https://pal-test.adyen.com/pal/adapter/httppost \ --data-urlencode ‘action=Recurring.listRecurringDetails’ \ --data-urlencode ‘recurringDetailsRequest.merchantAccount=YourAccountCode’ \ --data-urlencode ‘recurringDetailsRequest.recurring.contract=RECURRING’ --data-urlencode ‘recurringDetailsRequest.shopperReference=user123’ \ --data-urlencode ‘[email protected]’ \ ---Response ----recurringDetailsResult.shopperReference=user123 recurringDetailsResult.creationDate=2013-03-25T13:23:14+01:00 recurringDetailsResult.lastKnownShopperEmail=john.doe@example.com recurringDetailsResult.details.0.variant=mc recurringDetailsResult.details.0.recurringDetailReference=9913642141960010 recurringDetailsResult.details.0.creationDate=2013-03-25T13:23:16+01:00 recurringDetailsResult.details.0.card.number=1111 recurringDetailsResult.details.0.card.expiryMonth=6 recurringDetailsResult.details.0.card.expiryYear=2016 recurringDetailsResult.details.0.card.holderName=John Doe

---Submit a recurring charge

curl --user ‘username:password’ https://pal-test.adyen.com/pal/adapter/httppost \ --data-urlencode ‘action=Payment.authorise’ \ --data-urlencode ‘paymentRequest.amount.currency=EUR’ \ --data-urlencode ‘paymentRequest.amount.value=1234’ \ --data-urlencode ‘paymentRequest.merchantAccount=YourAccountCode’ \ --data-urlencode ‘paymentRequest.reference=Example Order 2’ \ --data-urlencode ‘paymentRequest.shopperReference=user123’ \ --data-urlencode ‘[email protected]’ \ --data-urlencode ‘paymentRequest.shopperInteraction=ContAuth’ \ --data-urlencode ‘paymentRequest.recurring.contract=RECURRING’ \ --data-urlencode ‘paymentRequest.selectedRecurringDetailReference=9913642141960010’ ---Response ----paymentResult.authCode=75682 paymentResult.pspReference=9913642244711617 paymentResult.resultCode=Authorised

(8)

---Client-side encryption Page 8

This information is available in large print, Braille or audio format by calling

0844 811 6666

** *Calls may be monitored or recorded to maintain high levels of security and quality of service. **For BT business customers, calls to 0844 811 numbers will cost no more than 5.5p per minute, min call charge 6p (current at January 2014). The price on non-BT phone lines may be different. Calls may be monitored and/or recorded. Barclaycard is a trading name of Barclays Bank PLC. Barclays Bank PLC is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority (Financial Services Register Number: 122702) and subscribes to the Lending Code which is monitored and enforced by the Lending Standards Board. Registered in England No: 1026167. Registered Office: 1 Churchill Place, London E14 5HP. BCD100962SP04. Created 01/14. 34366BD v1.0

Main benefits:

– the credit card data is never readable to you – stateless, synchronous processing - the solution does not rely on a session token. – uses existing Barclaycard SmartPay APIs, therefore all features are available: • 3D Secure • recurring • risk/fraud detection.

Find out more

To see the latest versions of our Barclaycard

SmartPay support manuals, please refer to

our resource centre website:

barclaycard.com/smartpay/documentation

To contact our support team email:

[email protected]

call 01604 269518

*

or from abroad

+441604 269518.

*

Support hours are Monday – Friday

09:00 to 18:00 GMT.

References

Related documents

ELEMENTS OF THE NEW MODEL Research Institutions Academic Institutions Government Private Sector Land Developers Venture Capital Entrepreneurs Non Profits Quasi-Governmental

Visualization of the genetic distances (Figure S1, Table S2) reproduces the clustering of south-west Asian, Italian with south-east European, Iberian and central European breeds

The FCC-ee enables precision measurements of the Z, the W, the Higgs boson and the top quark properties, together with those of input parameters to the standard model, such as

In previous work we used long time-series of weather conditions, annual reproductive effort and tree growth to demonstrate that mast years in Fagus sylvatica are associated

“I really don’t want to talk about Jane anymore.. I’ll help her figure it out later.” Molly cupped Ari’s face in

Nursing Consultant: These positions perform surveys of nursing conditions in health care facilities in the state. Nursing Specialist: These positions plan, develop, and

Similarly, activities of glutathione peroxidase (GPx), glutathione reductase (GR), superoxide dismutase (SOD), catalase (CAT), NADH- and NADPH- dehydrogenase were reduced in the

In a study of 78 consecutively re- cruited patients with rapid-cycling bipolar disorder treated with open-label valproate alone or in combination with other psychotropic