Excel encryption Implementation (c#\.net\asp. Net)

Source: Internet
Author: User
Tags nets

From this moment on, I have been sealed off! No pick-up!

Men like the wind, like the wind of character, unrestrained, eclectic. Then the question comes, when the wind meets the sand, not necessarily you are the wind , I am the sand son 's entangled ,. Perhaps is the sky yellow sand, the fly grain stone. If we want to seize the dust of the sky, we must have a strong arm! So the nets, nets, net! Let him be honest and close up, forever snuggle , Allah!

Read at the front:

1,Excel encryption implementation, This article is described in Microsoft Office 2007 as a case.

2. Microsoft Office Zero Office is based on the Open XML file (also known as OOXML or OpenXML or MOX, which is an XML -based and compressed in zip format Electronic document specification, supporting file formats such as documents, forms, memos, slides , etc.

3, this article can achieve C-side Excel encryption, S-side Excel encryption (no need to install any server components, to say goodbye to all the trouble ).

4. The encryption method of this paper can be used to encrypt. docx,. xlsx,. pptx, and other file types.

Well, let's get pickled cabbage!

1. Download our dependent components

Cryptographic components Download

2, Encryption! Start! over!

The project introduces Npoi.poifs.dll,npoi.util.dll,officeopenxmlcrypto.dll, the detail implementation code is as follows:

using (Officecryptostream stream = Officecryptostream.open (@ "location")) {     "  password";     Stream. Save ();}

Note:

1. Code Description: Location: Encrypted file path, password: encrypted password

2, encryption principle: Based on AES128, encryption key generation mode: SHA1, specific encryption details see Ms-offcrypto

3, other encryption technology stack: Epplus class Library,openxml 2.0 SDK See explosion network similar encryption QA

4. If you are deploying on IIS, you need to enable 32-bit mode for the Web site corresponding application pool.

5, reference links (all walls, self-owned VPN):

(1), http://www.lyquidity.com/devblog/?p=35

(2), https://msdn.microsoft.com/en-us/library/cc313071.aspx

(3), Https://en.wikipedia.org/wiki/Office_Open_XML

(4), https://code.google.com/archive/p/ooxmlcrypto/

By: Dolphin Bay-Fung

Excel encryption Implementation (c#\.net\asp. Net)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.