Question Compression via IOnic.Zip.dll
- Matthew BETTON
- Auteur du sujet
- Hors Ligne
- Membre platinium
-
- Messages : 968
- Remerciements reçus 0
Je continue d'avancer sur un module PowerShell qui utilise une DLL du dotnetzip .
J'ai un petit souci concernant la compression avec mot de passe.
e
Pour faire simple, ce code :
[code:1]$dir = \"C:\Windows\System32\WindowsPowerShell\v1.0\Modules\IonicZip\"
[System.Reflection.Assmbly]::LoadFrom(\"$dir\Ionic.Zip.dll\"«»)
$objZip = new-object Ionic.Zip.ZipFile
$objZip.Password = \"password\"
$objzip.AddDirectory(\"D:\tmp\test\"«»)
$objZip.Save(\"D:\tmp\test.zip\"«»)
$objZip.Dispose()
[/code:1]
fonctionne sur une machine... et pas sur une autre.
La compression est OK, mais sur l'un des postes, les données de l'archive ne sont pas protégées par mot de passe.
Le code étant simplifié, je ne comprends pas d'où cela peut venir. Un paramétrage sur le poste ? Un bug ?
Quelqu'un a t'il déjà rencontré ce problème ?
@ +
Matthew
Connexion ou Créer un compte pour participer à la conversation.
- Matthew BETTON
- Auteur du sujet
- Hors Ligne
- Membre platinium
-
- Messages : 968
- Remerciements reçus 0
When writing a zip archive, keep this in mind: though the password is set on the ZipFile object, according to the Zip spec, the \"directory\" of the archive - in other words the list of entries or files contained in the archive - is not encrypted with the password, or protected in any way. If you set the Password property, the password actually applies to individual entries that are added to the archive, subsequent to the setting of this property. The list of filenames in the archive that is eventually created will appear in clear text, but the contents of the individual files are encrypted. This is how Zip encryption works.
Si le fichier fait 0 octet : pas de cryptage, puisqu'il est vide
@ +
Matthew
Connexion ou Créer un compte pour participer à la conversation.
- Vous êtes ici :
-
Accueil
-
forum
-
PowerShell
-
Entraide pour les initiés
- Compression via IOnic.Zip.dll