secure3js
v1.0.4
Published
Secure 3D model viewer and RAM decryption engine for Three.js and React
Maintainers
Readme
secure3js (Secure3Js)
A secure React 3D viewer component and RAM-decryption engine powered by Three.js and Web Crypto API.
Features
- RAM-Only Decryption: Decrypts encrypted
.enc3D model files directly in memory using Web Crypto API (AES-GCM). No Blob URLs or temporary files created. - Three.js Integration: Automatically reconstructs 3D mesh geometry and materials from decrypted buffer data.
- React Component (
Secure3Viewer): LightweightSecure3ViewerReact component supporting dynamic mesh options, material swapping, and responsive viewport sizing.
Installation
npm install secure3js three react react-dom
# or
yarn add secure3js three react react-dom
# or
pnpm add secure3js three react react-domQuick Usage
import React from 'react';
import { Secure3Viewer } from 'secure3js';
function App() {
const rawKeyBuffer = new Uint8Array([/* your 16/32 byte decryption key */]).buffer;
return (
<div style={{ width: '100vw', height: '100vh' }}>
<Secure3Viewer
model="https://example.com/assets/model.enc"
rawKey={rawKeyBuffer}
/>
</div>
);
}
export default App;Exports
Secure3Viewer/ThreeViewer(React Component)decryptAndUnpack(Decryption Helper Function)Secure3ViewerProps/ThreeViewerProps(TypeScript Interfaces)
Publishing to NPM
npm publish --access publicLicense
MIT
