Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Encrypting a mix of signed and unsigned assemblies?

 
Post new topic   Reply to topic    Infralution Support Forum Index -> .NET Encryptor Support
View previous topic :: View next topic  
Author Message
Fishtail



Joined: 29 Sep 2011
Posts: 8

PostPosted: Thu Sep 29, 2011 3:26 pm    Post subject: Encrypting a mix of signed and unsigned assemblies? Reply with quote

We have an executable we'd like to protect with .NET Encryptor. It is unsigned because it references some unsigned third-party interop libraries. It also references some signed third-party components. The pre-build step for our bootstrapper project looks like this:

Code:
NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)WinForms.exe" outdir:"$(ProjectDir)Assemblies" /strongnamefile:"$(ProjectDir)StrongName.snk"
NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)log4net.dll" /outdir:"$(ProjectDir)Assemblies" /token:1b44e1d426115821


WinForms.exe is our main unsigned executable, StrongName.snk is the same key used to sign the bootstrapper itself, and log4net.dll is a signed assembly and the token shown was extracted with sn.exe. At runtime we get the following exception:

An unhandled exception (Error loading assembly Bootstrap.Assemblies.log4net.enc. Check that the assembly was encrypted using the same strong name parameters used to sign the Entry Assembly) occurred while bootstrapping the application.

Can you tell us what we're doing wrong?

Thanks!
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Sep 29, 2011 10:28 pm    Post subject: Reply with quote

All the assemblies must be encrypted using the same strong name as is used to sign the bootstrapper. So your pre-build should be:

Code:
NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)WinForms.exe" /outdir:"$(ProjectDir)Assemblies" /strongnamefile:"$(ProjectDir)StrongName.snk"
NetEncryptor "$(ProjectDir)..\WinForms\$(OutDir)log4net.dll" /outdir:"$(ProjectDir)Assemblies" /strongnamefile:"$(ProjectDir)StrongName.snk

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Fishtail



Joined: 29 Sep 2011
Posts: 8

PostPosted: Fri Sep 30, 2011 9:41 pm    Post subject: Reply with quote

That fixed it, thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> .NET Encryptor Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group