Files
playbook/skills/tsl-api-reference/references/codegen/builtin/object/tcipher.md
T
csh 9010829c6d feat(tsl-api-reference): expand and reorganize api catalog
Flatten builtin pages, add third-party and platform scopes, and import financial and data warehouse references.

Keep the existing generated index without rebuilding after signature normalization.
2026-08-10 18:26:24 +08:00

177 lines
3.6 KiB
Markdown

# Object - TCipher 对称加密
## `TCipher`
声明:class
TCipher 内置对象
### `create(mode)`
声明:function
创建 TCipher 实例
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `mode` | integer | mode,取值见下 |
### mode 取值
- `1` — DES_ECB(密钥长度(字节)8,IV长度(字节)0)
- `2` — DEC_CBC(密钥长度(字节)8,IV长度(字节)8)
- `3` — DES_CFB(密钥长度(字节)8,IV长度(字节)8)
- `4` — DES_OFB(密钥长度(字节)8,IV长度(字节)8)
- `5` — IDEA_ECB(密钥长度(字节)16,IV长度(字节)0)
- `6` — IDEA_CBC(密钥长度(字节)16,IV长度(字节)8)
- `7` — IDEA_CFB(密钥长度(字节)16,IV长度(字节)8)
- `8` — IDEA_OFB(密钥长度(字节)16,IV长度(字节)8)
- `9` — AES_128_ECB(密钥长度(字节)16,IV长度(字节)0)
- `10` — AES_128_CBC(密钥长度(字节)16,IV长度(字节)16)
- `11` — AES_128_CFB(密钥长度(字节)16,IV长度(字节)16)
- `12` — AES_128_OFB(密钥长度(字节)16,IV长度(字节)16)
- `13` — AES_192_ECB(密钥长度(字节)24,IV长度(字节)0)
- `14` — AES_192_CBC(密钥长度(字节)24,IV长度(字节)16)
- `15` — AES_192_CFB(密钥长度(字节)24,IV长度(字节)16)
- `16` — AES_192_OFB(密钥长度(字节)24,IV长度(字节)16)
- `17` — AES_256_ECB(密钥长度(字节)32,IV长度(字节)0)
- `18` — AES_256_CBC(密钥长度(字节)32,IV长度(字节)16)
- `19` — AES_256_CFB(密钥长度(字节)32,IV长度(字节)16)
- `20` — AES_256_OFB(密钥长度(字节)32,IV长度(字节)16)
### `decrypt(s)`
声明:function
字符串s的内容解密,返回解密后的字符串
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `s` | any | s |
返回:string
### `decryptFile(src_alias, src_filename, dest_alias, dest_filename)`
声明:function
对文件src_filename进行解密,加密后的内容写入dest_filename文件中
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `src_alias` | any | src_alias |
| `src_filename` | any | src_filename |
| `dest_alias` | any | dest_alias |
| `dest_filename` | any | dest_filename |
返回:any
### `encrypt(s)`
声明:function
对字符串s的内容加密,返回加密后的字符串
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `s` | any | s |
返回:string
### `encryptFile(src_alias, src_filename, dest_alias, dest_filename)`
声明:function
对文件src_filename进行加密,加密后的内容写入dest_filename文件中
可见性:public
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `src_alias` | any | src_alias |
| `src_filename` | any | src_filename |
| `dest_alias` | any | dest_alias |
| `dest_filename` | any | dest_filename |
返回:any
### `IV`
声明:property
初始化向量,hex字符串
可见性:public
类型:string
访问:write
### `Key`
声明:property
秘钥,hex字符串
可见性:public
类型:string
访问:write
### `KeyLength`
声明:property
密钥长度
可见性:public
类型:integer
访问:read
### `LVLength`
声明:property
初始化向量长度
可见性:public
类型:any
访问:read
### `Mode`
声明:property
算法类型
可见性:public
类型:integer
访问:write
### `Password`
声明:property
密码
可见性:public
类型:string
访问:write