文档
测试

p4组件-字符加密

POST

请求参数

参数名
类型
描述
必填
id
int
组件id
必填
code
string
组件code:preparation_value_encryption
必填
parents
string
父组件 多个逗号隔开
必填
children
string
子组件多个 逗号隔开
必填
value
object
组件具体参数
必填
operation
list
处理数据数组
必填
field
string
处理字段名
必填
opt_type
string
加密方式: hash:hash加密 fixed:固定填充 offset:偏移值加密
必填
deal_type
string
处理方式: new:新增 replace:替换
必填
new_name
string
新增字段名
可选
hash
object
opt_type为hash时的参数
可选
method
string
算法类型: md5: hash MD5算法 sha1: hash SHA1算法 sha2: hash SHA2算法
必填
fixed
object
opt_type为fixed时的参数
可选
position
string
定位逻辑 start:从前填充 end:从后填充 user:自定义填充
必填
fix_value
string
替换值
必填
length
int
填充长度
可选
end
int
自定义填充结束位
可选
start
int
自定义填充开始位置
可选
offset
object
opt_type为offset时的参数
可选
key
string
偏移值填充 密钥 长度必须为16、24、32位; 默认填充:123456789abcdefg
必填
iv
string
偏移值填充 偏移量 长度16位限制 ; 默认填充:123456789abcdefg
必填
padding
string
偏移值填充类型: pkcs7: Pkcs7填充 zero: ZeroPadding填充 默认选中:pkcs7
必填
method
string
加密算法 aes: 偏移值加密AES des: 偏移值加密DES
必填
name
string
组件名称,组件说明的描述字段
必填

说明 / 示例

字符加密是指对数据表中的字符串进行各种加密操作 ``` opt_type(加密方式): hash(hash加密) fixed(固定填充) offset(偏移值加密) deal_type(处理方式): new(新增) replace(替换) new_name(新增字段名) hash: method 算法类型:md5: MD5算法;sha1: SHA1算法sha2: SHA2算法 fixed: position(填充位置): start(从前填充) end(从后填充) user(自定义填充) start(填充开始位置) end(随机填充自定义结束位) length(填充长度) fix_value(替换值) offset: method(算法类型): aes(偏移值加密AES) des(偏移值加密DES) key(偏移值填充 密钥) iv(偏移值填充 偏移量) padding(偏移值填充类型):pkcs7(Pkcs7填充) zero(ZeroPadding填充) value{ "operation": [ { "field": "a.b", "type": "str", "opt_type": "hash", "hash":{"method":"md5"}, "deal_type":"new", "new_name": "b_md5" }, { "field": "a.b", "type": "str", "opt_type": "fixed", "deal_type":"new", "new_name": "b_fix", "fixed":{"position":"start", "fix_value":"*&", "length":4, } }, { "field": "a.b", "type": "str", "opt_type": "offset", "deal_type":"new", "new_name": "b_offset", "offset":{ "key":"0123456789abcdef0123456789abcdef", "iv":"0123456789abcdef", "padding":"zero", "method":"aes" } } ] } source= {'a':{'b':'1234567890'}} dest = {'a': {'b': '1234567890', 'b_md5': 'e807f1fcf82d132f9bb018ca6738a19f', 'b_fix': '*&*&567890', 'b_offset': 'daMa0hht+e/K/w27YNJqAQ=='}} ```