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.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user