Festlegen des starken Verschlüsselungstyps mit Node.js über C++

Verschlüsselung mit Microsoft Excel anwenden

Um die Dateiverschlüsselung in Microsoft Excel (zum Beispiel 2007) zu implementieren:

  1. Wählen Sie im Extras-Menü die Option Optionen aus.
  2. Wählen Sie den Tab Sicherheit aus.
  3. Geben Sie einen Wert für das Feld Kennwort zum Öffnen ein.
  4. Klicken Sie auf Erweitert.
  5. Wählen Sie den Verschlüsselungstyp aus und bestätigen Sie das Passwort.

Verschlüsselung mit Aspose.Cells anwenden

Die unten stehenden Codebeispiele wenden eine starke Verschlüsselung auf eine Datei an und setzen ein Passwort.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "Book1.xlsx");

// Instantiate a Workbook object.
// Open an excel file.
const workbook = new AsposeCells.Workbook(filePath);

// Specify Strong Encryption type (RC4,Microsoft Strong Cryptographic Provider).
workbook.setEncryptionOptions(AsposeCells.EncryptionType.StrongCryptographicProvider, 128);

// Password protect the file.
workbook.getSettings().setPassword("1234");

// Save the Excel file.
workbook.save(path.join(dataDir, "encryptedBook1.out.xls"));