What is MIME type "text/x-cryptol"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

text/x-cryptol is a MIME type that marks a file as containing Cryptol source code.
It tells the system and code editors that the file is plain text holding Cryptol language syntax. This helps with proper color-coding and editing features.
Cryptol is a domain-specific language built for describing and testing cryptographic algorithms. It lets researchers and developers write clear and verifiable definitions for how cryptographic processes work.
Files with this MIME type usually come with the file extension CRY.
For more details on Cryptol and its applications, visit the Cryptol project website.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: text/x-cryptol    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="text/x-cryptol">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'text/x-cryptol');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the text/x-cryptol MIME type used for?

The MIME type text/x-cryptol is used to identify source code files written in the Cryptol language. These files, typically ending in .cry, contain mathematical specifications for cryptographic algorithms and are stored as plain text.

How do I open a text/x-cryptol file?

Since these files are plain text, you can view and edit them in any standard text editor like Notepad++, Visual Studio Code, or Sublime Text. To execute or verify the code, you must install the Cryptol interpreter provided by Galois, Inc.

How do I configure Apache to serve .cry files correctly?

To ensure Apache serves .cry files with the correct text/x-cryptol MIME type, add the following line to your .htaccess file or main configuration: AddType text/x-cryptol .cry. This prevents browsers from treating the file as a generic download.

How do I add support for text/x-cryptol in Nginx?

For Nginx, you need to update your mime.types file or the http block of your nginx.conf. Add the entry text/x-cryptol cry; inside the types { ... } block to associate the extension with the correct content type.

Why does the MIME type start with "x-"?

The x- prefix indicates that text/x-cryptol is a non-standard or private subtype that has not been officially registered with the IANA. It is a convention used for custom formats to signal that the type is experimental or specific to a certain software ecosystem.

Are text/x-cryptol files dangerous?

Generally, no. Files with the text/x-cryptol type are inert plain text source code. They cannot execute code on your machine simply by being opened; however, you should always verify the source of any code before running it through the Cryptol interpreter.

Why is my browser downloading the .cry file instead of displaying it?

This usually happens if the web server is sending the file as application/octet-stream instead of text/x-cryptol or text/plain. To fix this, update your server's MIME type configuration to explicitly tell browsers that .cry files are text-based.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.