Jacob Quisenberry
Jacob Quisenberry

Reputation: 1199

Decrypt Lotus Notes NSF

I would like to decrypt Lotus Notes NSF files programmatically. Assume that for each NSF, I have the ID file and password needed to access the NSF.

I am using Lotus Notes 8.5.2, Windows 7 SP1 64-bit. I am willing to use COM, C++ API, or C API.

I am aware of the C API function NSFDbIsLocallyEncrypted, which reports whether an NSF is encrypted. However, I do not believe it is able to decrypt the NSF.

I am aware of the C++ API function LNNotesSession.CreateDatabaseCopy, which takes as parameter 3 DBOptions, which has a member that I can set as DBOptions.SetLocalEncryption( LNLOCALENCRYPTION::LNLOCALENCRYPTION_NONE ) . However, this function creates a new NSF. If possible, I would like to decrypt the source NSF in place to save time and disk space.

How can I remove local encryption from an NSF in place?

Upvotes: 3

Views: 9151

Answers (3)

sjcaged
sjcaged

Reputation: 649

To decrypt an NSF file which is encrypted with medium or strong encryption such that only a particular ID file can open it: log into that ID file, open the NSF you wish to decrypt, select application properties, and deselect "strong encryption". Then, select "compact database", close the properties, close everything associated with that NSF file, and then reopen the NSF file. When the file is reopened, it will be compacted. The compaction process updates everything to match the new state of that option. (You can do this with the API as well.)

To decrypt documents that are encrypted to the user's public key or to a shared/named encryption key that exists within the user's ID, you must write an agent or API program which opens every document in the database and calls NSFNoteDecrypt, then NSFNoteUpdate upon each.

Upvotes: 2

user2216512
user2216512

Reputation: 1

Ytria does appear to have a software solution for this (DatabaseEZ) where you can set database encryption settings en-masse, though I have not tried it. The free lite version of the software doesn't seem to allow it.

Upvotes: -1

Richard Schwartz
Richard Schwartz

Reputation: 14628

AFAIK, there is no exposed API for decrypting an NSF file.

Also, since the entire file needs to be rewritten in order to decrypt all the data, I don't think there's really any time or space penalty for copying the entire NSF.

Upvotes: 5

Related Questions