• Facebook
  • Twitter
  • Youtube
  • LinedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Download
  • Contact Us
  • Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Download
  • Configure Security
  • Configure Encryption for Cache
Show / Hide Table of Contents
  • Administrator's Guide
  • NCache Architecture
    • Cache Topologies
      • Partitioned Topologies
      • Replicated Topology
      • Mirrored Topology
      • Scalability in Topologies
    • Dynamic Clustering
    • Local Cache
    • Cache Client
    • Client Cache
    • Bridge for WAN Replication
    • Connectivity with Load Balancer
    • Serialization Format
    • Data Encryption
    • Data Compression
    • Data Load Balancing
    • Pipelining
    • Cache Server Backward Compatibility
    • Client Backward Compatibility
    • Eviction
    • Indexing
    • Split-Brain
    • Maintenance Mode
    • Runtime Data Sharing
    • Portable Data Types
    • Class Versioning
    • IP Binding with Multiple NICs
    • Graceful Node Down
    • Separate Cache Host Process
    • Self Healing Dynamic Clustering
    • Distributed Cache with Persistence
  • NCache Management Center
  • Configure Caches
    • Create a Cache
      • Local Cache Overview
        • Local Cache
        • Local Cache with Persistence
        • Pub/Sub Messaging Cache
        • Add Existing Cache
      • Clustered Cache Overview
        • Distributed Cache
        • Distributed Cache with Persistence
        • Pub/Sub Messaging Cache
        • Add Existing Cache
        • Troubleshooting
    • Remove Cache
    • Clear Cache
    • Add Server Node
    • Remove Server Node
    • Add Test Data
    • Configure Query Indexes
    • Configure JSON Query Indexes
    • Compact Serialization
      • Non-Generic Registration
      • Non-Generic Unregistration
      • Generic Registration
      • Using Type Handler
    • Deploy Providers
    • Configure Custom Dependency
    • Add Data Source Providers
      • Read-through Provider
      • Write-through Provider
      • Write-behind Provider
    • Loader and Refresher
    • Configure Maintenance Mode
      • Stop for Maintenance Mode
      • Exit Maintenance Mode
    • Configure LINQPad
      • Configure LinqPad for NCache
      • Querying Data in LinqPad
  • Configure Clients
    • Add Client Node
    • Remove Client Node
  • Configure Client Cache
    • Create Client Cache
    • Create Client Cache with NuGet
    • Enable Client Cache on Client Nodes
    • Disable Client Cache on Client Nodes
    • Remove Client Cache
  • Management Operations
    • Start Cache
    • Stop Cache
    • Restart Cache
    • Manage Cache Service on a Server Node
    • Data Load Balancing
    • Invoke Refresher Dataset
    • Import/Export Cache Data
    • Suspend/Resume NCache Data Persistence
    • Backup and Restore NCache Persisted Data
  • Cache Settings
    • General Cache Settings
      • Cache Size
      • Cache Isolation Levels
      • Cache Serialization Format
      • Cache Data Expiration
    • Cache Cluster Settings
      • Ports
      • Operation Timeout
      • Configure Pipelining
      • Statistic Replication Interval
      • Connection Retries
      • Retry Interval
      • Split-Brain Auto Recovery
    • NCache Persistence Settings
      • Store Information
      • Persistence Interval
    • Error Logging
    • Cache Level Events
    • Client Activity Events
    • Eviction Policy
    • MapReduce
    • Register Classes for Portable Data Sharing
    • Compression
    • Email Notifications
    • Bind IP with Multiple NICs
    • Heartbeat
    • Keep Alive
    • Client Death Detection
    • Communication Reliability
    • Auto Start Cache on Boot
    • Dual Socket
    • Configuration Files
      • Client Side Configurations
        • Client Config
        • EF Caching Config
      • Server Side Configurations
        • Cache Config
        • Bridge Config
        • Security Config
        • TLS Config
        • Monitoring Config
        • Emails Template
  • Cache Server Settings
    • Client Connectivity Settings
    • Bind to Multiple NICs
    • Server Ports
    • Memory
    • Custom Dependency
    • Request Inquiry
    • Windows Events
    • Message Events
    • Expiration & Eviction
    • SQL Server Dependency
    • Logging
    • Monitoring
    • Persistence Cache Settings
    • Security Settings
    • Pub/Sub Configuration
    • Nagle's Algorithm Setting
    • General Configurations
  • Bridge Server Settings
  • Cache Client Settings
  • Client Cache Settings
  • Configure Security
    • Configure Authentication and Authorization
    • Configure Encryption for Cache
    • Configure TLS Encryption
    • Configure HTTPS for NCache Management Center
  • Configure Bridge for WAN Replication
    • Create Bridge
    • Add Clustered Caches to Bridge
    • Configure Bridge Settings
    • Change Cache Synchronization Modes
    • Bridge Management
    • Synchronize Caches in Bridge
    • Leave Bridge
    • Remove Cache from Bridge
    • Configure Conflict Resolver
  • Setup Database for Cache Synchronization
    • Setup SQL Server Environment
    • Setup Oracle Database Environment
    • Setup OleDb Environment
    • Setup SQL Server for CLR Procedures
  • Simulate NCache Usage
  • Monitor Caches
    • Counters
      • Distributed Cache Counters
      • Distributed Cache with Persistence Counters
      • Pub/Sub Messaging Cache Counters
      • Cache Client Counters
      • Bridge Counters
    • Monitor NCache Using the NCache Management Center
      • Using Monitoring Dashboards
        • Configure Monitor Settings
        • Configure Event Logging
        • Configure API Logging
        • Built-in Dashboard
        • Custom Dashboard
        • Cluster Connectivity
        • NCache Email Alerts
      • Using Tabular Statistics
        • Configure Counters to Display Caching Statistics
        • Configure Counters to Display Pub/Sub Statistics
        • Configure Counters to Display Bridge Statistics
        • Browse Cache Statistics
        • Monitor Bridge
    • Monitor NCache Using Command Line Tools
      • Cache Server Statistics Using Command Line Tools
      • Cache Client Statistics Using Command Line Tools
    • Monitor NCache Using Windows PerfMon Tool
      • Cache Server Counters Using PerfMon
      • Cache Client Counters Using PerfMon
      • Bridge Counters Using PerfMon Tool
    • Monitor NCache Using Prometheus
    • Monitor NCache Using Grafana
    • Monitor NCache Using SNMP Counters
    • Monitor NCache Using JMX Counters
    • Memory Dumps
    • Logging
      • NCache Log Viewer
      • Performance Counters Logging
      • Windows Event Logging
      • Cache Health Alerts
      • Email Notifications on NCache Events
      • Cache Server Logging
      • Client Side API Logging
      • Cache Event IDs
      • Feature Usage Logging
    • Troubleshooting NCache Monitoring
      • Computer Name Not Found
      • Diskperf Not Installed
      • No READ Access to Perflib Subkeys
      • Unable to Connect to Remote Server
    • IPV6 Support

Configure Data Encryption for Cache

Data Encryption for cache can be configured in the following way. Read more about how it works, here.

How to Add or Change KEK and CEK

You can add or change KEK and CEK for both, the remote client and cache server, through either manually editing the configuration file or by using the Command Line tool, as discussed below:

Manually Editing NCache Configuration

  • To add or change KEK, update the NCache Service configuration file using the following key-value pair:
<add key="NCacheServer.KeyEncryptionKey" value="[Valid AES 256 KEY]"/>
  • Similarly, to add or change CEK, update the NCache Service configuration file using the following key-value pair:
<add key="NCacheServer.CredentialsEncryptionKey" value="[Valid AES 256 KEY]"/>
Important

The NCache Service will not start unless valid KEK and CEK are provided in the NCache Service configuration file.

By default, the NCache installer adds default keys (predefined Encryption keys) to the configuration file. For enhanced security, it is recommended to update the KEK and CEK in the NCache Service configuration file for remote clients or cache servers. After updating the keys, restart the NCache Service and cache processes for the changes to take effect.

Important

The KEK and CEK on a remote client can be different from the server nodes, but all server nodes must use the same KEK and CEK.

Using Command Line Tools

The Set-NCServiceConfigSetting command modifies or adds a key-value pair in the Alachisoft.NCache.Service.dll.config file on NCache servers. If the change is hot-applicable, it takes effect immediately without needing to restart the NCache service. The following commands sets different key-value pairs in theAlachisoft.NCache.Service.dll.config file.

  • Windows
  • Linux CLI
  • This command sets the NCacheServer.EventBulkCount key-value pair in the Alachisoft.NCache.Service.dll.config file as per your requirement.
Set-NCServiceConfigSetting -Key NCacheServer.EventBulkCount -Value 50
  • This command sets the NCacheServer.EnableCacheLastAccessCount key-value pair in the Alachisoft.NCache.Service.dll.config file on the server 20.200.20.11.
Set-NCServiceConfigSetting -Key NCacheServer.EnableCacheLastAccessCount -Value false -Server 20.200.20.11
  • This command sets the NCacheServer.EnableCommandThresholdLogging key-value pair in the Alachisoft.NCache.Service.dll.config file as per your requirement.
Set-NCServiceConfigSetting -Key NCacheServer.EnableCommandThresholdLogging -Value false
  • This command sets the NCacheServer.EnableCommandThresholdLogging key-value pair in the Alachisoft.NCache.Service.dll.config file as per your requirement, using security credentials.
Set-NCServiceConfigSetting -Key NCacheServer.EnableCommandThresholdLogging -Value false -Credentials(Get-Credential john_smith)
  • This command sets the NCacheServer.EventBulkCount key-value pair in the Alachisoft.NCache.Daemon.dll.config as per your requirement.
set-ncserviceconfigsetting -key NCacheServer.EventBulkCount -value 50
  • This command sets the NCacheServer.EnableCacheLastAccessCount key-value pair in the Alachisoft.NCache.Daemon.dll.config on the server 20.200.20.11.
set-ncserviceconfigsetting -key NCacheServer.EnableCacheLastAccessCount -value false -server 20.200.20.11
  • This command sets the NCacheServer.EnableCommandThresholdLogging key-value pair in the Alachisoft.NCache.Daemon.dll.config as per your requirement.
set-ncserviceconfigsetting -key NCacheServer.EnableCommandThresholdLogging -value false
  • This command sets the NCacheServer.EnableCommandThresholdLogging key-value pair in the Alachisoft.NCache.Service.dll.config file as per your requirement, using security credentials.
set-ncserviceconfigsetting -key NCacheServer.EnableCommandThresholdLogging -value false -userid john_smith -password pass123

These keys are discussed below:

Keys Data Types Value Description
NCacheServer.EventBulkCount <String> 50 Specifies the number of events grouped and sent together from the server to the client and this bulk size is configurable. This is only available in client version 4124 or above. The default value is 50, and it cannot be set to less than 1.
NCacheServer.EnableCacheLastAccessCount <String> False Enables or disables the collection of LastAccessCount data, which tracks the number of times a cached item was accessed.
NCacheServer.EnableCommandThresholdLogging <String> False The NCacheServer.EnableCommandThresholdLogging controls threshold logging for data source operations (e.g., ReadThru, WriteThru). When enabled, NCache tracks the execution time of operations performed through the data source provider and logs a warning if any operation exceeds the defined CommandExecutionThreshold.

Configuring Encryption

For an existing cache, Encryption can be enabled in the following steps:

Using the NCache Management Center

  • Launch the NCache Management Center by browsing to http://localhost:8251 or <server-ip>:8251.

  • In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache to which Encryption will be configured. Against the cache name, click on View Details.

Add Query Indexes

  • This opens up the detailed configuration page for the cache. Go to the Advanced Settings tab and click on Security and Encryption in the left bar.

  • Add Users or Groups in the Authorization section. Please note that you need to enable node security on all cache servers before adding cache users or groups.

  • Under Encryption, select the Enable Encryption checkbox to enable Encryption.

  • Select the Encryption provider as per your requirement from the given Providers dropdown list.

Encryption NCache Management Center

  • Enter the Encryption key in the Key text box. This is a 32-character key for a 256-bit Encryption algorithm.
Note

Different Encryption providers require different key lengths.

Encryption NCache Management Center

  • Click on Save Changes to apply this configuration to the cache.
Note

Encryption can be enabled at the time of cache creation.

Using Command Line Tools

Encryption can also be configured using PowerShell cmdlets to enable and disable Encryption as discussed below.

Enable Encryption

To enable Encryption on your cache server, run the following command. This command enables the Encryption on the cache server 20.200.20.40 for the demoCache.

  • Windows
  • Linux
Enable-NCEncryption -CacheName demoCache -Server 20.200.20.40 -Key ctzXMnyvK2qbZvBZQ3nLrTavQKI9Q9cz -Provider AES256
enable-ncencryption -cachename demoCache -server 20.200.20.40 -key ctzXMnyvK2qbZvBZQ3nLrTavQKI9Q9cz -provider AES256

Disable Encryption

To disable Encryption on your cache server, run the following command. This command disables the Encryption on the cache server 20.200.20.40 for the demoCache.

  • Windows
  • Linux
Disable-NCEncryption -CacheName demoCache -Server 20.200.20.40
disable-ncencryption -cachename demoCache -server 20.200.20.40 

Manually Editing NCache Configuration

Your config.ncconf will contain the following tag:

<configuration>
...
    <encryption enable-encryption="True" key="ctzXMnyvK2qbZvBZQ3nLrTavQKI9Q9cz" provider="AES 256"/>
...
</configuration>

Configure TLS Encryption in NCache

While NCache offers Encryption, simple Encryption doesn't guarantee security without performance costs. NCache requires data to travel for out-of-process communication in various ways based on your setup, such as between servers and clients, different servers, caches, and bridges. You can secure specific communication streams with TLS if needed, based on vulnerability and network security assurance.

See Also

Configure TLS Encryption in NCache
Configure Security for Cache

In This Article
  • How to Add or Change KEK and CEK
    • Manually Editing NCache Configuration
    • Using Command Line Tools
  • Configuring Encryption
    • Using the NCache Management Center
    • Using Command Line Tools
    • Enable Encryption
    • Disable Encryption
    • Manually Editing NCache Configuration
  • Configure TLS Encryption in NCache
  • See Also

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Community
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top