Why is the result different every time I use tiup dmctl --encrypt "123456"? Which one should I use?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiup dmctl --encrypt “123456” 为啥每次结果都不一样啊,我到底要用哪一个啊

| username: xingzhenxiang

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] tiup dmctl --encrypt “123456” Why is the result different every time? Which one should I use?
[Encountered Problem: Problem Phenomenon and Impact]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: 啦啦啦啦啦 | Original post link

It’s normal. For the same original password, the encrypted password is different each time.

| username: xingzhenxiang | Original post link

Can I use any one of them?

| username: 啦啦啦啦啦 | Original post link

Yes, either one is fine.

| username: xingzhenxiang | Original post link

Okay, thanks for the reply. I’ll give it a try.

| username: Kongdom | Original post link

The IV used for encryption is different each time, so the encrypted string is different each time.

The code implementation is here.

| username: xingzhenxiang | Original post link

I may not understand the code, but thank you anyway.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.