C#을 사용하여 Zip 아카이브를 잠그는 방법

.NET용 Aspose.Zip은 개발자가 쉽게 zip 아카이브를 잠그고 파일에 추가 보안 계층을 추가할 수 있는 강력한 애플리케이션입니다. Aspose.Zip 라이브러리에서 제공하는 Lock 방법을 활용하여 개발자는 손쉽게 zip 아카이브에 대한 암호를 설정할 수 있습니다. 이 기능은 승인된 개인만 아카이브의 내용에 액세스할 수 있도록 하여 민감한 데이터를 무단 액세스로부터 보호합니다. ZIP, GZIP, BZIP2, TAR, CPIO, LZIP, 7Z, LZMA, XZ 및 Z와 같은 다양한 압축 형식을 지원하는 Aspose.Zip은 다양한 아카이브 유형 작업을 위한 포괄적인 솔루션을 제공합니다. 직관적이고 사용자 친화적인 API를 통해 개발자는 웹 기반 또는 에 관계없이. 암호 보호 기능을 .NET 응용 프로그램에 원활하게 통합할 수 있습니다. Windows, Linux 또는 macOS에서 실행되는 “>Zip 온라인 애플리케이션 개발자는 Aspose.Zip을 활용하여 zip 아카이브의 보안을 강화하고 파일의 기밀성을 보장할 수 있습니다.

File Compression and Archive .NET API로 NuGet 패키지 관리

.NET용 Aspose.ZIP은 .NET 개발자가 다양한 아카이브 처리 작업을 처리하도록 설계된 강력한 클래스 라이브러리입니다. ZIP, GZIP, BZIP2, TAR, CPIO, LZIP, 7Z, LZMA, XZ 및 Z와 같은 여러 형식을 지원하여 광범위한 기능을 제공합니다. 개발자는 이 라이브러리를 활용하여 파일을 암호화 및 해독하고 자동 압축 해제 아카이브를 만들고 RAR, CAB 및 WIM 형식을 추출할 수 있습니다.

API는 사용자 친화적이며 단순성과 안정성을 제공합니다. . 관리되는 C#을 사용하여 구현되며 C#, VB.NET 및 F#을 포함한 모든 .NET 언어와 원활하게 통합할 수 있습니다. ASP.NET 웹 응용 프로그램에서 작업하든 응용 프로그램을 형성하든 Windows, Linux 또는 MacOS 등 운영 체제에 관계없이 쉽게 통합할 수 있습니다. .NET용 Aspose.ZIP을 활용함으로써 개발자는 .NET 애플리케이션 내에서 아카이브 처리 작업을 처리할 수 있는 다목적 솔루션을 얻을 수 있습니다.


C#에서 Zip 아카이브를 보호하는 단계

Protecting archive using password with

Aspose.ZIP for .NET

APIs can be done with just few lines of code.

  • Create FileStream object with the output ZIP archive file path as parameter with mod FileMode.Create.
  • Open and read the source file into a FileStream object with mod FileMode.Open and FileAccess.Read.
  • Create Archive class object with ArchiveEntrySettings object as parameter.
  • Use TraditionalEncryptionSettings as parameters to ArchiveEntrySettings.
  • Use Archive.Save(FileStream) method for creating the archive.

시스템 요구 사항

Before running the conversion example code, make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with .NET Framework, Mono and COM Interop.
  • Development environment like Microsoft Visual Studio.
  • Aspose.Tasks for .NET DLL referenced in your project.

ZIP 아카이브 잠금 - C# 코드 예제

using (FileStream zipFile = File.Open(dataDir + "CompressWithTraditionalEncryption_out.zip", FileMode.Create))
{
    using (FileStream source1 = File.Open(dataDir + "alice29.txt", FileMode.Open, FileAccess.Read))
    {
        var archive = new Archive(new ArchiveEntrySettings(null, new TraditionalEncryptionSettings("p@s$")));
        archive.CreateEntry("alice29.txt", source1);
        archive.Save(zipFile);
    }
}



FAQ 섹션

People have been asking

1. How can I unlock a password-protected zip archive?

To unlock a password-protected zip archive, you need to provide the correct password. You can use the appropriate method or property of the zip library you are using to set the password, and then extract the files from the archive using that password.

2. Can I remove or change the password of a locked zip archive?

Yes, it is possible to remove or change the password of a locked zip archive. You can use the library’s methods or properties to modify the password. Typically, you would need to provide the current password to remove it or provide the current password along with the new password to change it.

3. Is it possible to recover a forgotten password for a locked zip archive?

Recovering a forgotten password for a locked zip archive is extremely difficult, if not impossible, without specialized tools. Zip archives are designed to provide strong encryption, and forgetting the password means losing access to the contents of the archive. It is recommended to keep your passwords safe and secure to avoid such situations.

보호된 ZIP 아카이빙 작업

Aspose.Zip은 ZIP 아카이브의 보안을 더욱 강화하기 위해 다양한 암호화 옵션을 제공합니다. 개발자는 AES128, AES192 및 AES256과 같은 AES 암호화 알고리즘을 활용하여 아카이브 내의 파일을 암호화할 수 있습니다. 이를 통해 특정 보안 요구 사항에 맞게 다양한 키 길이로 더 강력한 암호화가 가능합니다. 또한 Aspose.Zip은 단일 아카이브 내에서 여러 파일의 암호화를 지원하므로 개발자가 특정 요구 사항에 따라 혼합 암호화 기술을 활용할 수 있습니다. 이러한 고급 암호화 기능을 통해 Aspose.Zip은 개발자가 강력한 보안 조치를 구현하여 ZIP 아카이브 내의 중요한 데이터를 보호할 수 있도록 합니다.

기타 지원되는 Aspose.Zip for .NET API 기능

Aspose.Zip C# 라이브러리를 사용하여 아카이브를 변환, 압축, 잠금, 잠금 해제, 추출 등을 수행하십시오!

Compression (Archive compressions)
Conversions (Rar to 7Zip)
Extract (Extracting Archives)
Lock (Archive lock)
Lock (Archive unlock)
ZIP Viewer (ZIP File Viewer)
Creating Archive (Add files or folders to ZIP)