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

recovery key generation method #67

Open
nblog opened this issue Sep 26, 2023 · 1 comment
Open

recovery key generation method #67

nblog opened this issue Sep 26, 2023 · 1 comment

Comments

@nblog
Copy link

nblog commented Sep 26, 2023

In the "Recovery Key" section,there is no mention of how to generate it, so I'll add the method for that,It comes from one of the tools I analyzed.

std::srand(static_cast<std::uint32_t>(std::time(0)));

std::array<uint8_t, 16> tmpvalue = { 0 };

for (size_t i = 0; i < 16; i++)
{
	tmpvalue[i] = uint8_t(int(double(std::rand()) * 0.000030517578125 * 255.0 + 0.0));
}

std::array<std::string, 8> blocks;

for (size_t i = 0; i < 8; i++)
{
	char szBuffer[20] = { 0 };
	sprintf(szBuffer, "%06d", ((uint16_t*)(tmpvalue.data()))[i] * 11);
	blocks[i] = szBuffer;
}

return blocks[0] 
	+ "-" + blocks[1]
	+ "-" + blocks[2]
	+ "-" + blocks[3]
	+ "-" + blocks[4]
	+ "-" + blocks[5]
	+ "-" + blocks[6]
	+ "-" + blocks[7];

@joachimmetz ,i hope this helps.

@joachimmetz
Copy link
Member

I'll have a look when time permits, the goal of this project has mostly been to read BitLocker volumes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@joachimmetz @nblog and others