強力な暗号化方式の設定

Microsoft Excelでの暗号化の適用

Microsoft Excel(たとえば2007)でファイルの暗号化を実装するには:

  1. ツールメニューからオプションを選択します。
  2. セキュリティタブを選択します。
  3. 開くためのパスワードフィールドに値を入力します。
  4. 高度 をクリックします。
  5. 暗号化方式を選択し、パスワードを確認します。

Aspose.Cellsを使用した暗号化の適用

以下のコード例は、ファイルに強力な暗号化を適用し、パスワードを設定します。

from aspose.cells import EncryptionType, Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Instantiate a Workbook object.
# Open an excel file.
workbook = Workbook(dataDir + "Book1.xlsx")
# Specify Strong Encryption type (RC4,Microsoft Strong Cryptographic Provider).
workbook.set_encryption_options(EncryptionType.STRONG_CRYPTOGRAPHIC_PROVIDER, 128)
# Password protect the file.
workbook.settings.password = "1234"
# Save the Excel file.
workbook.save(dataDir + "encryptedBook1.out.xls")