Files
SkycrateBackend/src/main/java/com/skycrate/backend/skycrateBackend/entity/FileMetadata.java
T
notkshitij c88cb5ac0e Add secure file upload and download with per-user AES encryption
- FileController encrypts uploads using AES-GCM with salt and IV.
- Downloads are decrypted on-the-fly using user-supplied password.
- File metadata (salt, IV, username, path) stored in DB.
2025-07-03 02:32:42 +05:30

23 lines
364 B
Java

package com.skycrate.backend.skycrateBackend.entity;
import jakarta.persistence.*;
@Entity
public class FileMetadata {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String filePath;
private String username;
@Lob
private byte[] salt;
@Lob
private byte[] iv;
// Getters and Setters
}