---
title: encrypt
description: "输入明文字符串，输出密文字符串；或交互输入明文字符串，输出密文字符串。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/230RC5/bds/kunpengbds_omniruntime_20_0156.html
sourcePath: /source/zh/kunpengboostkithistory/230RC5/bds/kunpengbds_omniruntime_20_0156.html
indexId: 4b0ccb06a8dd913d7a07f8331403b426354d1eecd2cf5a4e5455fb3edbf3ce5280
---
# encrypt

#### 命令功能

输入明文字符串，输出密文字符串；或交互输入明文字符串，输出密文字符串。


#### 命令格式

./kmc_tool domainID --encrypt [stdin]plainText


#### 参数说明

| 参数 | 说明 |
| --- | --- |
| domainID | 域ID。 域名domainID划分：keypass 0、whitelist 1、keytab\_server 2、keytab\_client 3，划分不同域，方便密钥管理。 |
| plainText | 明文。 |
| stdin | 进入交互模式，输入明文后回车加密。 |


#### 使用指南

生成加密口令之前建议关闭系统历史记录功能，避免密码被记录下来，可在口令生成后再打开该功能。


#### 使用实例

```
set +o history
./kmc_tool 0 --encrypt "helloworld"
set -o history
```
