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

Support of encrypted DMG? #46

Open
tomkoen opened this issue Dec 19, 2017 · 6 comments
Open

Support of encrypted DMG? #46

tomkoen opened this issue Dec 19, 2017 · 6 comments

Comments

@tomkoen
Copy link
Contributor

tomkoen commented Dec 19, 2017

AES-128 and AES-256. Is it actually possible? Thanks.

@LubosD
Copy link
Member

LubosD commented Dec 19, 2017

Do you mean FileValut, so using something like this? https://github.com/libyal/libfvde

@tomkoen
Copy link
Contributor Author

tomkoen commented Apr 23, 2018

This is already implemented here:
https://github.com/sgan81/apfs-fuse/blob/master/ApfsLib/DeviceDMG.cpp
You could use this approach.

@tomkoen
Copy link
Contributor Author

tomkoen commented Apr 29, 2018

What do you think?
EncryptedReader.cpp
EncryptedReader.h

@tomkoen
Copy link
Contributor Author

tomkoen commented Apr 29, 2018

And here goes this

#ifdef COMPILE_WITH_DECRYPTION_SUPPORT
	#include "decrypt/EncryptedReader.h"
#endif

#ifdef COMPILE_WITH_DECRYPTION_SUPPORT
DMGDisk::DMGDisk(std::shared_ptr<Reader>reader, const std::string &password)
#else
DMGDisk::DMGDisk(std::shared_ptr<Reader>reader)
#endif
	: m_reader(reader), m_zone(40000)
{
#ifdef COMPILE_WITH_DECRYPTION_SUPPORT
	if (EncryptedReader::isEncryptedDMG(reader))
	{
		auto encReader = std::make_shared<EncryptedReader>(m_reader);

		if (encReader && encReader->setupEncryptionV2(password))
			m_reader = encReader;
		else
		{
			throw std::runtime_error("Invalid password specified");
		}
	}
#endif

@LubosD
Copy link
Member

LubosD commented Apr 30, 2018

Looks good to me!

@kleuter
Copy link

kleuter commented Apr 30, 2018

I'll make a pull request soon then

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

3 participants