Appendix / AES Encryption

Encryption method description

Use HashKey and HasIV for AES encryption. Please urlencode the payload before AES encryption.

  • AES encryption strength setting mode : 128 bit
  • CipherMode : CBC
  • PaddingMode : PKCS7

❗ Special Notes:

  1. Following information are only for testing API integrations at Stage. Do not use it at Production.
  2. When you finish testing and about to go to Production, please replace the MerchantID, HashKey and HashIV with real ones that you apply to ECPay.

Example (encryption):

  • MerchantID=2000132
  • HashKey=ejCk326UnaZWKisg
  • HashIV=q9jcZX8Ib9LM8wYk

(1) Data before encryption:

				
					{"Name":"Test","ID":"A123456789"}
				
			

(2) URLEncode:

     2.1 When special characters are encoded to uppercase English letters:

				
					%7B%22Name%22%3A%22Test%22%2C%22ID%22%3A%22A123456789%22%7D
				
			

     2.2 When special characters are encoded to lowercase English letters:

				
					%7b%22Name%22%3a%22Test%22%2c%22ID%22%3a%22A123456789%22%7d
				
			

(3) AES encryption:

     3.1 Encryption result when special characters are encoded to uppercase English letters:

				
					uvI4yrErM37XNQkXGAgRgJAgHn2t72jahaMZzYhWL1HmvH4WV18VJDP2i9pTbC+tby5nxVExLLFyAkbjbS2Dvg==
				
			

     3.2 Encryption result when special characters are encoded to lowercase English letters:

				
					ZD/z07UvdmL3aYz0tsVo+bFXF5VldNcns6ezyfea777KOmLiizrUNDYe+v1bh2QTT4AySf1NICgXxWXB6f7c6A==
				
			

Example (decryption)

  • MerchantID=2000132
  • HashKey=ejCk326UnaZWKisg
  • HashIV=q9jcZX8Ib9LM8wYk

(1) Data (AES encrypted):

     1.1 Encryption result when special characters are encoded to uppercase English letters:

				
					uvI4yrErM37XNQkXGAgRgJAgHn2t72jahaMZzYhWL1HmvH4WV18VJDP2i9pTbC+tby5nxVExLLFyAkbjbS2Dvg==
				
			

     1.2 Encryption result when special characters are encoded to lowercase English letters:

				
					ZD/z07UvdmL3aYz0tsVo+bFXF5VldNcns6ezyfea777KOmLiizrUNDYe+v1bh2QTT4AySf1NICgXxWXB6f7c6A==
				
			

(2) After decryption:

     2.1 When special characters are encoded to uppercase English letters:

				
					%7B%22Name%22%3A%22Test%22%2C%22ID%22%3A%22A123456789%22%7D
				
			

     2.2 When special characters are encoded to lowercase English letters:

				
					%7b%22Name%22%3a%22Test%22%2c%22ID%22%3a%22A123456789%22%7d
				
			

(3) URL Decode:

				
					{"Name":"Test","ID":"A123456789"}
				
			

Copyright © Green World FinTech Service Co., Ltd. All rights reserved.

Green World