Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何修改 Key #7

Closed
LandChanning opened this issue Mar 23, 2018 · 3 comments
Closed

如何修改 Key #7

LandChanning opened this issue Mar 23, 2018 · 3 comments

Comments

@LandChanning
Copy link

请问如何将 key 修改一下啊
`
char *getKey() {
int n = 0;
char s[23];//"NMTIzNDU2Nzg5MGFiY2RlZg";

s[n++] = 'N';
s[n++] = 'M';
s[n++] = 'T';
s[n++] = 'I';
s[n++] = 'z';
s[n++] = 'N';
s[n++] = 'D';
s[n++] = 'U';
s[n++] = '2';
s[n++] = 'N';
s[n++] = 'z';
s[n++] = 'g';
s[n++] = '5';
s[n++] = 'M';
s[n++] = 'G';
s[n++] = 'F';
s[n++] = 'i';
s[n++] = 'Y';
s[n++] = '2';
s[n++] = 'R';
s[n++] = 'l';
s[n++] = 'Z';
s[n++] = 'g';
char *encode_str = s + 1;
return b64_decode(encode_str, strlen(encode_str));

//初版hidekey的方案

}
`

我改动了 s 的值后,decode就是乱码了,我在项目中也没发现定义 base64 之前的 key 的地方。
不好意思 c 小白,肯请告知。

@BruceWind
Copy link
Owner

BruceWind commented Mar 23, 2018

这代码里的key == "N"+base64("1234567890abcdef")
你用同样的算法 ,把你的key得到一个值之后 ,写到这个代码里即可。

@BruceWind
Copy link
Owner

我这里只是做简单的算法,你可以把这个算法写的更加的复杂。

@LandChanning
Copy link
Author

好的,我试下
多谢

@LandChanning LandChanning reopened this Mar 24, 2018
This was referenced May 30, 2018
@zxp0505 zxp0505 mentioned this issue Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants