001 /* 002 * =========================================================================================== 003 * = COPYRIGHT 004 * PAX Computer Technology (Shenzhen) Co., Ltd. PROPRIETARY INFORMATION 005 * This software is supplied under the terms of a license agreement or nondisclosure 006 * agreement with PAX Computer Technology (Shenzhen) Co., Ltd. and may not be copied or 007 * disclosed except in accordance with the terms in that agreement. 008 * Copyright (C) 2017-2023 PAX Computer Technology (Shenzhen) Co., Ltd. All rights reserved. 009 * Description: // Detail description about the function of this module, 010 * // interfaces with the other modules, and dependencies. 011 * Revision History: 012 * Date Author Action 013 * 2017/04/01 PAX Create/Add/Modify/Delete 014 * =========================================================================================== 015 */ 016 017package com.pax.dal.entity; 018 019/** 020 * <div class="zh"> MAC模式定义 </div> <div class="en"> MAC Mode </div> 021 * 022 * @author Steven.W 023 * 024 */ 025public enum EPedMacMode { 026 027 /** 028 * <div class="zh"> 将BLOCK1用MAC密钥做DES/TDES加密,加密结果与BLOCK2进行逐位异或后再用TAK做DES/TDES加密,依次进行得到8字节的加密结果。 </div> <div 029 * class="en"> According to ANSI X9.9 standard, do DES/TDES encryption for BLOCK1 by using MAC key. Doing DES/TDES 030 * encryption again by using TAK when and after bitwise XOR the previous encryption result with BLOCK2. Processing 031 * in turn to get the 8 bytes encryption result </div> 032 */ 033 MODE_00((byte) 0x00), 034 /** 035 * <div class="zh"> 将BLOCK1和BLOCK2进行逐位异或,异或结果与BLOCK3进行逐位异或,依次进行,最后得到8字节的异或结果,将该结果用TAK进行DES/TDES加密运算。 </div> <div 036 * class="en"> In the Hypercom Fast Mode, do bitwise XOR for BLOCK1 and BLOCK2; Do bitwise XOR again by using 037 * previous XOR result with BLOCK3. Execute it in turn and finally get the 8 bytes XOR result. Using TAK to process 038 * DES/TDES encryption for the result. </div> 039 */ 040 MODE_01((byte) 0x01), 041 /** 042 * <div class="zh"> 043 * ANSIX9.19规范,将BLOCK1用TAK做DES加密(只取前8个字节的key),加密结果与BLOCK2进行逐位异或后再用TAK做DES加密,依次进行得到8字节的加密结果,直到最后一次采用DES/TDES加密。 044 * </div> <div class="en"> According to ANSIX9.19 standard, do DES encryption for BLOCK1 by using TAK (only take the 045 * first 8 bytes of key). The encryption result wills bitwise XOR with BLOCK2, and then doing DES encryption by 046 * using TAK again. Do it in turn and get the 8 bytes encryption result. Using DES/TDES to encrypt in the last time 047 * </div> 048 */ 049 MODE_02((byte) 0x02), 050 /** 051 * <div class="zh"> 052 * CMAC算法。KSN不自动加1。 053 * </div><div class="en">CMAC algorithm. KSN does not automatically increase by 1. 054 * </div> 055 * @since V3.25.00 056 */ 057 MODE_03((byte) 0x03), 058 /** 059 * <div class="zh"> 060 * HMAC-SHA256算法。KSN不自动加1。 061 * 其它值保留扩展MAC算法。 062 * </div> <div class="en"> HMAC-SHA256 algorithm. KSN does not automatically increase by 1. 063 * Other values retain the extended MAC algorithm. 064 * </div> 065 * @since V3.25.00 066 */ 067 MODE_05((byte) 0x05), 068 069 /** 070 * <div class="zh"> 071 * mac key的APACS70OWF MAC计算。 072 * </div> <div class="en">APACS70OWF MAC calculation of mac key.</div> 073 * @since V3.34.00 074 */ 075 MODE_06((byte) 0x06); 076 077 078 private byte pedMacMode; 079 080 private EPedMacMode(byte pedMacMode) { 081 this.pedMacMode = pedMacMode; 082 } 083 084 public byte getPedMacMode() { 085 return pedMacMode; 086 } 087}