Encrypt XSL

Posted on 2006-05-25
Last Modified: 2010-08-05

I'm looking for a solution to protect the xsl from our outsite vendors from seeing it. I'm creating a Java desktop application to do the transform works.

Is there a secure way to encrypt the xsl? I think the XSL can be compiled into a class. I wonder how secure it could be if somebody try to reverse engineer it to get to the source (or close to the original source).

I hope the experts in this field can provide some valuable insight.

I'm open to other suggestion as well. Thank you!


Question by:owonseed
    LVL 12

    Accepted Solution

    First thing that comes to mind is: Saxon 8 allows you to precompile stylesheets, making it not easily human readable. Also speeds up the process if you use the same xsl many times.

    Alternatively, you could encrypt all your xsl files, and decrypt them in your java application before running the transformations.

    Author Comment

    Saxon has limitation on the XSL compilation:

    "Stylesheet compilation is not currently supported for schema-aware stylesheets, specifically, for stylesheets that contain an <xsl:import-schema> declaration."

    This unfortunately does not allow me to use the Saxon XSL Compilation.

    If I encrypt the XSL using java, and decrypt it when I need it, would the decrypted XSL be stored as memory or physical file in local temp folder? My concern is whether a user can look for the decrypted XSL file from the local file system.

    - OwonSeed
    LVL 60

    Assisted Solution

    by:Geert Bormans
    Hi owonseed,

    unless you have a schema aware stylesheet (if you do you are basically bound to Saxon)
    xsltc would be the first that comes to my mind
    (this is java bytecode generated by xalan)


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now