Protect a presentation with a password
Overview
Encrypt a presentation before saving it so opening the file requires a password. Your application chooses the password and supplies it again when loading the protected file. Use this when the presentation’s contents should not be accessible merely by opening the document.
Usage example (C#)
Install Aspose.Slides for .NET before running this standalone example. Create an encrypted copy with a dummy demonstration password. The in-memory deck is saved only to a new file; use a real secret supplied by your application in production.
using System;
using Aspose.Slides;
using Aspose.Slides.Export;
using var presentation = new Presentation();
var shape = presentation.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 40, 40, 500, 140);
shape.AddTextFrame("Sample slide");
presentation.ProtectionManager.Encrypt("demo-open-123");
presentation.Save("protected.pptx", SaveFormat.Pptx);
using var opened = new Presentation("protected.pptx", new LoadOptions { Password = "demo-open-123" });
Console.WriteLine(opened.Slides.Count);
FAQ
Is an opening password the same as write protection?
No. An opening password protects access to the file’s contents. Write protection is a separate setting for editing behavior.
Can I save an encrypted copy while leaving the source presentation unchanged?
Yes. Save the encrypted deck to a different path so the original file is retained.
Can I remove encryption after opening with the correct password?
Yes. Open it with the correct password, remove encryption and save a new copy.
Guides
Related feature: Set a password for editing.