├── .dockerignore ├── .editorconfig ├── .env ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── dependabot.yml └── workflows │ ├── build-and-push-api.yml │ ├── build-and-push-web.yml │ ├── codeql-analysis.yml │ ├── deploy-to-environment.yml │ ├── pr-build-api.yml │ ├── pr-build-web.yml │ └── unit-test.yml ├── .gitignore ├── CONTRIBUTING.md ├── Crypter.API ├── .gitignore ├── Attributes │ └── MaybeAuthorizeAttribute.cs ├── Configuration │ ├── JwtBearerConfiguration.cs │ └── SwaggerConfiguration.cs ├── Contracts │ ├── ModelBinders │ │ └── FormDataJsonBinder.cs │ ├── UploadFileTransferBundle.cs │ └── UploadMessageTransferBundle.cs ├── Controllers │ ├── AccountRecoveryController.cs │ ├── Base │ │ ├── CrypterControllerBase.cs │ │ └── TransferControllerBase.cs │ ├── ConsentController.cs │ ├── FileTransferController.cs │ ├── MessageTransferController.cs │ ├── UserAuthenticationController.cs │ ├── UserContactController.cs │ ├── UserController.cs │ ├── UserKeyController.cs │ ├── UserSettingController.cs │ ├── VersionController.cs │ └── WellKnownController.cs ├── Crypter.API.csproj ├── Dockerfile ├── MetadataProviders │ └── EmptyStringMetadataProvider.cs ├── Methods │ └── HeadersParser.cs ├── Middleware │ └── ExceptionHandlerMiddleware.cs ├── Program.cs ├── Properties │ ├── PublishProfiles │ │ └── FolderProfile.pubxml │ └── launchSettings.json ├── README.md ├── appsettings.Development.json └── appsettings.json ├── Crypter.Benchmarks ├── Assets │ └── WindowsCodecsRaw.dll ├── Config │ └── AntivirusFriendlyConfig.cs ├── Core_Benchmarks │ ├── Old_Implementations │ │ └── TransferStorageService_SingleFile.cs │ └── TransferStorageService_Benchmarks.cs ├── Crypter.Benchmarks.csproj └── Program.cs ├── Crypter.Common.Client ├── Crypter.Common.Client.csproj ├── Enums │ ├── BrowserStorageLocation.cs │ ├── DeviceStorageObjectType.cs │ ├── PasswordHashType.cs │ └── TransferTransmissionType.cs ├── Events │ ├── EmitRecoveryKeyEventArgs.cs │ ├── PasswordHashBeginEventArgs.cs │ ├── PasswordHashEndEventArgs.cs │ ├── UserContactInfoChangedEventArgs.cs │ ├── UserLoggedInEventArgs.cs │ ├── UserPasswordTestSuccessEventArgs.cs │ └── UserSessionServiceInitializedEventArgs.cs ├── HttpClients │ ├── CrypterApiClient.cs │ ├── CrypterAuthenticatedHttpClient.cs │ ├── CrypterHttpClient.cs │ └── Requests │ │ ├── Common.cs │ │ ├── FileTransferRequests.cs │ │ ├── MessageTransferRequests.cs │ │ ├── UserAuthenticationRequests.cs │ │ ├── UserConsentRequests.cs │ │ ├── UserContactRequests.cs │ │ ├── UserKeyRequests.cs │ │ ├── UserRecoveryRequests.cs │ │ ├── UserRequests.cs │ │ ├── UserSettingRequests.cs │ │ ├── VersionRequests.cs │ │ └── WellKnownRequests.cs ├── Interfaces │ ├── HttpClients │ │ ├── ICrypterApiClient.cs │ │ ├── ICrypterAuthenticatedHttpClient.cs │ │ └── ICrypterHttpClient.cs │ ├── Repositories │ │ ├── IDeviceRepository.cs │ │ ├── ITokenRepository.cs │ │ ├── IUserKeysRepository.cs │ │ └── IUserSessionRepository.cs │ ├── Requests │ │ ├── IFileTransferRequests.cs │ │ ├── IMessageTransferRequests.cs │ │ ├── IUserAuthenticationRequests.cs │ │ ├── IUserConsentRequests.cs │ │ ├── IUserContactRequests.cs │ │ ├── IUserKeyRequests.cs │ │ ├── IUserRecoveryRequests.cs │ │ ├── IUserRequests.cs │ │ ├── IUserSettingRequests.cs │ │ ├── IVersionRequests.cs │ │ └── IWellKnownRequests.cs │ └── Services │ │ ├── IEventfulUserKeysService.cs │ │ ├── IUserContactsService.cs │ │ ├── IUserKeysService.cs │ │ ├── IUserPasswordService.cs │ │ ├── IUserRecoveryService.cs │ │ ├── IUserSessionService.cs │ │ └── UserSettings │ │ ├── IUserContactInfoSettingsService.cs │ │ ├── IUserNotificationSettingsService.cs │ │ ├── IUserPasswordChangeService.cs │ │ ├── IUserPrivacySettingsService.cs │ │ ├── IUserProfileSettingsService.cs │ │ └── IUserTransferSettingsService.cs ├── Models │ ├── ClientApiSettings.cs │ ├── RecoveryKey.cs │ ├── TokenObject.cs │ └── UserSession.cs ├── Repositories │ ├── MemoryKeysRepository.cs │ ├── MemoryTokenRepository.cs │ └── MemoryUserSessionRepository.cs ├── Services │ ├── EventfulUserKeysService.cs │ ├── UserContactsService.cs │ ├── UserKeysService.cs │ ├── UserPasswordService.cs │ ├── UserRecoveryService.cs │ ├── UserSessionService.cs │ └── UserSettings │ │ ├── UserContactInfoSettingsService.cs │ │ ├── UserNotificationSettingsService.cs │ │ ├── UserPasswordChangeService.cs │ │ ├── UserPrivacySettingsService.cs │ │ ├── UserProfileSettingsService.cs │ │ └── UserTransferSettingsService.cs └── Transfer │ ├── Handlers │ ├── Base │ │ ├── DownloadHandler.cs │ │ ├── IUserDownloadHandler.cs │ │ ├── IUserUploadHandler.cs │ │ └── UploadHandler.cs │ ├── DownloadFileHandler.cs │ ├── DownloadMessageHandler.cs │ ├── UploadFileHandler.cs │ └── UploadMessageHandler.cs │ ├── Models │ ├── ClientTransferSettings.cs │ └── UploadHandlerResponse.cs │ └── TransferHandlerFactory.cs ├── Crypter.Common ├── Attributes │ └── VersionControlMetadataAttribute.cs ├── Contracts │ ├── ErrorResponse.cs │ ├── Features │ │ ├── AccountRecovery │ │ │ ├── RequestRecovery │ │ │ │ └── SendRecoveryEmailError.cs │ │ │ └── SubmitRecovery │ │ │ │ ├── AccountRecoverySubmission.cs │ │ │ │ └── SubmitAccountRecoveryError.cs │ │ ├── Contacts │ │ │ ├── AddUserContactError.cs │ │ │ └── UserContact.cs │ │ ├── Keys │ │ │ ├── GetMasterKey │ │ │ │ ├── GetMasterKeyError.cs │ │ │ │ └── GetMasterKeyResponse.cs │ │ │ ├── GetMasterKeyRecoveryProof │ │ │ │ ├── GetMasterKeyRecoveryProofError.cs │ │ │ │ ├── GetMasterKeyRecoveryProofRequest.cs │ │ │ │ └── GetMasterKeyRecoveryProofResponse.cs │ │ │ ├── GetPrivateKey │ │ │ │ ├── GetPrivateKeyError.cs │ │ │ │ └── GetPrivateKeyResponse.cs │ │ │ ├── InsertKeyPair │ │ │ │ ├── InsertKeyPairError.cs │ │ │ │ └── InsertKeyPairRequest.cs │ │ │ └── InsertMasterKey │ │ │ │ ├── InsertMasterKeyError.cs │ │ │ │ └── InsertMasterKeyRequest.cs │ │ ├── Transfer │ │ │ ├── Delete │ │ │ │ └── AbandonMultipartFileTransferError.cs │ │ │ ├── DownloadCiphertext │ │ │ │ └── DownloadTransferCiphertextError.cs │ │ │ ├── GetReceivedTransfers │ │ │ │ ├── UserReceivedFileDTO.cs │ │ │ │ └── UserReceivedMessageDTO.cs │ │ │ ├── GetSentTransfers │ │ │ │ ├── UserSentFileDTO.cs │ │ │ │ └── UserSentMessageDTO.cs │ │ │ ├── Preview │ │ │ │ ├── FileTransferPreviewResponse.cs │ │ │ │ ├── MessageTransferPreviewResponse.cs │ │ │ │ └── TransferPreviewError.cs │ │ │ └── Upload │ │ │ │ ├── FinalizeMultipartFileTransferError.cs │ │ │ │ ├── InitiateMultipartFileTransferResponse.cs │ │ │ │ ├── UploadFileTransferRequest.cs │ │ │ │ ├── UploadMessageTransferRequest.cs │ │ │ │ ├── UploadMultipartFileTransferError.cs │ │ │ │ ├── UploadTransferError.cs │ │ │ │ └── UploadTransferResponse.cs │ │ ├── UserAuthentication │ │ │ ├── Login │ │ │ │ ├── LoginError.cs │ │ │ │ ├── LoginRequest.cs │ │ │ │ └── LoginResponse.cs │ │ │ ├── Logout │ │ │ │ └── LogoutError.cs │ │ │ ├── PasswordChallenge │ │ │ │ ├── PasswordChallengeError.cs │ │ │ │ └── PasswordChallengeRequest.cs │ │ │ ├── PasswordChange │ │ │ │ ├── PasswordChangeError.cs │ │ │ │ └── PasswordChangeRequest.cs │ │ │ ├── Refresh │ │ │ │ ├── RefreshError.cs │ │ │ │ └── RefreshResponse.cs │ │ │ ├── Registration │ │ │ │ ├── RegistrationError.cs │ │ │ │ └── RegistrationRequest.cs │ │ │ └── VersionedPassword.cs │ │ ├── UserConsents │ │ │ ├── UserConsentRequest.cs │ │ │ └── UserConsentType.cs │ │ ├── UserSettings │ │ │ ├── ContactInfoSettings │ │ │ │ ├── ContactInfoSettings.cs │ │ │ │ ├── GetContactInfoSettingsError.cs │ │ │ │ ├── UpdateContactInfoSettingsError.cs │ │ │ │ └── UpdateContactInfoSettingsRequest.cs │ │ │ ├── NotificationSettings │ │ │ │ ├── GetNotificationSettingsError.cs │ │ │ │ ├── NotificationSettings.cs │ │ │ │ └── UpdateNotificationSettingsError.cs │ │ │ ├── PrivacySettings │ │ │ │ ├── GetPrivacySettingsError.cs │ │ │ │ ├── PrivacySettings.cs │ │ │ │ └── SetPrivacySettingsError.cs │ │ │ ├── ProfileSettings │ │ │ │ ├── GetProfileSettingsError.cs │ │ │ │ ├── ProfileSettings.cs │ │ │ │ └── SetProfileSettingsError.cs │ │ │ ├── TransferSettings │ │ │ │ ├── GetTransferSettingsError.cs │ │ │ │ └── GetTransferSettingsResponse.cs │ │ │ └── VerifyEmailAddress │ │ │ │ ├── VerifyEmailAddressError.cs │ │ │ │ └── VerifyEmailAddressRequest.cs │ │ ├── Users │ │ │ ├── GetUserProfile │ │ │ │ ├── GetUserProfileError.cs │ │ │ │ └── UserProfile.cs │ │ │ └── UserSearch │ │ │ │ ├── UserSearchParameters.cs │ │ │ │ └── UserSearchResult.cs │ │ ├── Version │ │ │ └── VersionResponse.cs │ │ └── WellKnown │ │ │ ├── Jwks │ │ │ ├── JsonWebKeyModel.cs │ │ │ └── JwksResponse.cs │ │ │ └── OpenIdConfiguration │ │ │ └── OpenIdConfigurationResponse.cs │ ├── InfrastructureErrorCodes.cs │ └── StreamDownloadResponse.cs ├── Crypter.Common.csproj ├── Enums │ ├── TokenType.cs │ ├── TransferItemType.cs │ ├── TransferUserType.cs │ ├── UserCategory.cs │ ├── UserItemTransferPermission.cs │ └── UserVisibilityLevel.cs ├── Exceptions │ ├── ConfigurationException.cs │ ├── InvalidTokenException.cs │ └── NotInitializedException.cs ├── Infrastructure │ ├── InvalidEnumValueException.cs │ ├── JsonEnumConverter.cs │ ├── LongStringConverter.cs │ ├── UrlSafeEncoder.cs │ └── VersionProvider.cs ├── Mappers │ └── UploadTransferErrorMapper.cs ├── Primitives │ ├── AuthenticationPassword.cs │ ├── Base64String.cs │ ├── EmailAddress.cs │ ├── Enums │ │ ├── ByteArrayPrimitiveValidationFailure.cs │ │ └── StringPrimitiveValidationFailure.cs │ ├── Exceptions │ │ ├── ValueContainsInvalidCharactersException.cs │ │ ├── ValueEmptyException.cs │ │ ├── ValueInvalidException.cs │ │ ├── ValueNullException.cs │ │ ├── ValueTooLongException.cs │ │ └── ValueTooShortException.cs │ ├── Password.cs │ ├── Username.cs │ └── Validators │ │ ├── ByteArrayPrimitiveValidationHandler.cs │ │ └── StringPrimitiveValidationHandler.cs └── Services │ └── VersionService.cs ├── Crypter.Core ├── AssemblyInfo.cs ├── Crypter.Core.csproj ├── DataContextExtensions │ ├── DbContextExtensions.cs │ └── UserEntityExtensions.cs ├── DependencyInjection.cs ├── Exceptions │ └── HangfireJobException.cs ├── Features │ ├── AccountRecovery │ │ ├── Commands │ │ │ ├── DeleteRecoveryParametersCommand.cs │ │ │ ├── SendAccountRecoveryEmailCommand.cs │ │ │ └── SubmitAccountRecoveryCommand.cs │ │ ├── Common.cs │ │ ├── Events │ │ │ └── AccountRecoverySucceededEvent.cs │ │ └── Models │ │ │ └── PerformRecoveryResult.cs │ ├── EventLog │ │ └── Commands │ │ │ ├── LogFailedMultipartTransferAbandonCommand.cs │ │ │ ├── LogFailedMultipartTransferFinalizationCommand.cs │ │ │ ├── LogFailedMultipartTransferInitializationCommand.cs │ │ │ ├── LogFailedMultipartTransferUploadCommand.cs │ │ │ ├── LogFailedTransferDownloadCommand.cs │ │ │ ├── LogFailedTransferPreviewCommand.cs │ │ │ ├── LogFailedTransferUploadCommand.cs │ │ │ ├── LogFailedUserLoginCommand.cs │ │ │ ├── LogFailedUserRegistrationCommand.cs │ │ │ ├── LogSuccessfulMultipartTransferAbandonCommand.cs │ │ │ ├── LogSuccessfulMultipartTransferFinalizationCommand.cs │ │ │ ├── LogSuccessfulMultipartTransferInitializationCommand.cs │ │ │ ├── LogSuccessfulMultipartTransferUploadCommand.cs │ │ │ ├── LogSuccessfulTransferDownloadCommand.cs │ │ │ ├── LogSuccessfulTransferPreviewCommand.cs │ │ │ ├── LogSuccessfulTransferUploadCommand.cs │ │ │ ├── LogSuccessfulUserLoginCommand.cs │ │ │ └── LogSuccessfulUserRegistrationCommand.cs │ ├── Keys │ │ ├── Commands │ │ │ ├── DeleteUserKeysCommand.cs │ │ │ ├── InsertKeyPairCommand.cs │ │ │ └── UpsertMasterKeyCommand.cs │ │ ├── MasterKeyValidators.cs │ │ └── Queries │ │ │ ├── GetJwksQuery.cs │ │ │ ├── GetMasterKeyProofQuery.cs │ │ │ ├── GetMasterKeyQuery.cs │ │ │ └── GetPrivateKeyQuery.cs │ ├── Notifications │ │ └── Commands │ │ │ └── SendTransferNotificationCommand.cs │ ├── Reports │ │ ├── Commands │ │ │ └── SendApplicationsAnalyticsReportCommand.cs │ │ ├── Models │ │ │ └── ApplicationAnalyticsReport.cs │ │ └── Queries │ │ │ └── ApplicationAnalyticsReportQuery.cs │ ├── Transfer │ │ ├── Commands │ │ │ ├── AbandonMultipartFileTransferCommand.cs │ │ │ ├── DeleteTransferCommand.cs │ │ │ ├── DeleteUserReceivedTransfersCommand.cs │ │ │ ├── FinalizeMultipartFileTransferCommand.cs │ │ │ ├── GetAnonymousFileCiphertextCommand.cs │ │ │ ├── GetAnonymousMessageCiphertextCommand.cs │ │ │ ├── GetUserFileCiphertextCommand.cs │ │ │ ├── GetUserMessageCiphertextCommand.cs │ │ │ ├── InitializeMultipartFileTransferCommand.cs │ │ │ ├── SaveFileTransferCommand.cs │ │ │ ├── SaveMessageTransferCommand.cs │ │ │ └── SaveMultipartFileTransferCommand.cs │ │ ├── Common.cs │ │ ├── Events │ │ │ ├── FailedMultipartFileTransferAbandonEvent.cs │ │ │ ├── FailedMultipartFileTransferFinalizationEvent.cs │ │ │ ├── FailedMultipartFileTransferInitializationEvent.cs │ │ │ ├── FailedMultipartFileTransferUploadEvent.cs │ │ │ ├── FailedTransferDownloadEvent.cs │ │ │ ├── FailedTransferPreviewEvent.cs │ │ │ ├── FailedTransferUploadEvent.cs │ │ │ ├── SuccessfulMultipartFileTransferAbandonEvent.cs │ │ │ ├── SuccessfulMultipartFileTransferFinalizationEvent.cs │ │ │ ├── SuccessfulMultipartFileTransferInitializationEvent.cs │ │ │ ├── SuccessfulMultipartFileTransferUploadEvent.cs │ │ │ ├── SuccessfulTransferDownloadEvent.cs │ │ │ ├── SuccessfulTransferPreviewEvent.cs │ │ │ └── SuccessfulTransferUploadEvent.cs │ │ └── Queries │ │ │ ├── AnonymousFilePreviewQuery.cs │ │ │ ├── AnonymousMessagePreviewQuery.cs │ │ │ ├── UserFilePreviewQuery.cs │ │ │ ├── UserMessagePreviewQuery.cs │ │ │ ├── UserReceivedFilesQuery.cs │ │ │ ├── UserReceivedMessagesQuery.cs │ │ │ ├── UserSentFilesQuery.cs │ │ │ └── UserSentMessagesQuery.cs │ ├── UserAuthentication │ │ ├── Commands │ │ │ ├── ChangeUserPasswordCommand.cs │ │ │ ├── DeleteFailedLoginAttemptCommand.cs │ │ │ ├── RefreshUserSessionCommand.cs │ │ │ ├── UserLoginCommand.cs │ │ │ ├── UserLogoutCommand.cs │ │ │ └── UserRegistrationCommand.cs │ │ ├── Common.cs │ │ ├── Events │ │ │ ├── FailedUserLoginEvent.cs │ │ │ ├── FailedUserRegistrationEvent.cs │ │ │ ├── IncorrectPasswordProvidedEvent.cs │ │ │ ├── RefreshTokenCreatedEvent.cs │ │ │ ├── SuccessfulUserLoginEvent.cs │ │ │ └── SuccessfulUserRegistrationEvent.cs │ │ └── Queries │ │ │ └── TestUserPasswordQuery.cs │ ├── UserConsent │ │ ├── Commands │ │ │ └── SaveUserConsentCommand.cs │ │ └── Queries │ │ │ └── GetUserConsentsQuery.cs │ ├── UserContacts │ │ ├── Commands │ │ │ ├── AddUserContactCommand.cs │ │ │ └── RemoveUserContactCommand.cs │ │ └── Queries │ │ │ └── GetUserContactsQuery.cs │ ├── UserEmailVerification │ │ ├── Commands │ │ │ ├── DeleteEmailVerificationCommand.cs │ │ │ └── SendVerificationEmailCommand.cs │ │ └── Common.cs │ ├── UserSettings │ │ ├── Commands │ │ │ ├── UpdateContactInformationCommand.cs │ │ │ ├── UpdateNotificationSettingsCommand.cs │ │ │ ├── UpdatePrivacySettingsCommand.cs │ │ │ └── UpdateProfileSettingsCommand.cs │ │ ├── Common.cs │ │ ├── Events │ │ │ └── EmailAddressChangeRequestEvent.cs │ │ └── Queries │ │ │ ├── ContactInformationSettingsQuery.cs │ │ │ ├── NotificationSettingsQuery.cs │ │ │ ├── PrivacySettingsQuery.cs │ │ │ ├── ProfileSettingsQuery.cs │ │ │ └── TransferSettingsQuery.cs │ ├── UserToken │ │ └── Commands │ │ │ └── DeleteUserTokenCommand.cs │ ├── Users │ │ └── Queries │ │ │ ├── UserProfileQuery.cs │ │ │ └── UserSearchQuery.cs │ └── Version │ │ └── Queries │ │ └── GetVersionsQuery.cs ├── Identity │ ├── PasswordVersion.cs │ ├── RefreshTokenData.cs │ ├── SecurePasswordHashOutput.cs │ ├── ServerPasswordSettings.cs │ ├── TokenKeyProvider.cs │ ├── TokenParametersProvider.cs │ ├── TokenSettings.cs │ └── Tokens │ │ ├── EdDsaAlgorithm.cs │ │ ├── EdDsaSecurityKey.cs │ │ └── EdDsaSignatureProvider.cs ├── LinqExpressions │ └── LinqUserExpressions.cs ├── MediatorMonads │ ├── IEitherRequest.cs │ ├── IMaybeRequest.cs │ └── UnitPublisher.cs ├── Models │ ├── UserEmailAddressVerificationParameters.cs │ └── UserRecoveryParameters.cs ├── Repositories │ └── TransferRepository.cs ├── Services │ ├── Email │ │ ├── EmailService.cs │ │ ├── EmailServiceStartupExtensions.cs │ │ └── EmailServiceTemplateExtensions.cs │ ├── HangfireBackgroundService.cs │ ├── HashIdService.cs │ ├── PasswordHashService.cs │ ├── TokenService.cs │ ├── TransferOwnershipService.cs │ └── UserEmailVerificationService.cs └── Settings │ ├── AnalyticsSettings.cs │ ├── CorsSettings.cs │ ├── DatabaseSettings.cs │ ├── EmailSettings.cs │ ├── HangfireSettings.cs │ ├── HashIdSettings.cs │ └── TransferStorageSettings.cs ├── Crypter.Crypto.Common ├── ConstantTime │ └── IConstantTime.cs ├── Crypter.Crypto.Common.csproj ├── CryptoHash │ ├── CryptoHash.cs │ └── ICryptoHash.cs ├── DigitalSignature │ ├── Ed25519KeyPair.cs │ └── IDigitalSignature.cs ├── Encryption │ └── IEncryption.cs ├── GenericHash │ └── IGenericHash.cs ├── ICryptoProvider.cs ├── KeyExchange │ ├── AbstractKeyExchange.cs │ ├── IKeyExchange.cs │ └── X25519KeyPair.cs ├── Padding │ └── IPadding.cs ├── PasswordHash │ ├── AbstractPasswordHash.cs │ ├── Constants.cs │ ├── IPasswordHash.cs │ ├── MemLimit.cs │ └── OpsLimit.cs ├── Random │ └── IRandom.cs ├── StreamEncryption │ ├── DecryptionStream.cs │ ├── EncryptionStream.cs │ ├── IStreamDecrypt.cs │ ├── IStreamEncrypt.cs │ └── IStreamEncryptionFactory.cs └── StreamGenericHash │ ├── IStreamGenericHash.cs │ └── IStreamGenericHashFactory.cs ├── Crypter.Crypto.Providers.Browser ├── BrowserCryptoProvider.cs ├── Crypter.Crypto.Providers.Browser.csproj └── Wrappers │ ├── CryptoHash.cs │ ├── DigitalSignature.cs │ ├── Encryption.cs │ ├── GenericHash.cs │ ├── KeyExchange.cs │ ├── Padding.cs │ ├── PasswordHash.cs │ ├── Random.cs │ ├── StreamDecrypt.cs │ ├── StreamEncrypt.cs │ ├── StreamEncryptionFactory.cs │ ├── StreamGenericHash.cs │ └── StreamGenericHashFactory.cs ├── Crypter.Crypto.Providers.Default ├── Crypter.Crypto.Providers.Default.csproj ├── DefaultCryptoProvider.cs └── Wrappers │ ├── ConstantTime.cs │ ├── DigitalSignature.cs │ ├── Encryption.cs │ ├── GenericHash.cs │ ├── KeyExchange.cs │ ├── Padding.cs │ ├── PasswordHash.cs │ ├── Random.cs │ ├── StreamDecrypt.cs │ ├── StreamEncrypt.cs │ ├── StreamEncryptionFactory.cs │ ├── StreamGenericHash.cs │ └── StreamGenericHashFactory.cs ├── Crypter.DataAccess ├── Crypter.DataAccess.csproj ├── DataContext.cs ├── DependencyInjection.cs ├── Entities │ ├── AnonymousFileTransferEntity.cs │ ├── AnonymousMessageTransferEntity.cs │ ├── ApplicationSettingEntity.cs │ ├── EventLogEntity.cs │ ├── Interfaces │ │ ├── IFileTransfer.cs │ │ ├── IMessageTransfer.cs │ │ ├── ITransferBase.cs │ │ ├── IUserPublicKeyPair.cs │ │ └── IUserTransfer.cs │ ├── JsonTypes │ │ └── EventLogAdditionalData │ │ │ ├── FailedMultipartTransferAbandonAdditionalData.cs │ │ │ ├── FailedMultipartTransferFinalizationAdditionalData.cs │ │ │ ├── FailedMultipartTransferInitializationAdditionalData.cs │ │ │ ├── FailedMultipartTransferUploadAdditionalData.cs │ │ │ ├── FailedTransferDownloadAdditionalData.cs │ │ │ ├── FailedTransferPreviewAdditionalData.cs │ │ │ ├── FailedTransferUploadAdditionalData.cs │ │ │ ├── FailedUserLoginAdditionalData.cs │ │ │ ├── FailedUserRegistrationAdditionalData.cs │ │ │ ├── SuccessfulMultipartTransferAbandonAdditionalData.cs │ │ │ ├── SuccessfulMultipartTransferFinalizationAdditionalData.cs │ │ │ ├── SuccessfulMultipartTransferInitializationAdditionalData.cs │ │ │ ├── SuccessfulMultipartTransferUploadAdditionalData.cs │ │ │ ├── SuccessfulTransferDownloadAdditionalData.cs │ │ │ ├── SuccessfulTransferPreviewAdditionalData.cs │ │ │ ├── SuccessfulTransferUploadAdditionalData.cs │ │ │ ├── SuccessfulUserLoginAdditionalData.cs │ │ │ └── SuccessfulUserRegistrationAdditionalData.cs │ ├── TransferTierEntity.cs │ ├── UserConsentEntity.cs │ ├── UserContactEntity.cs │ ├── UserEmailChangeEntity.cs │ ├── UserEntity.cs │ ├── UserFailedLoginEntity.cs │ ├── UserFileTransferEntity.cs │ ├── UserKeyPairEntity.cs │ ├── UserMasterKeyEntity.cs │ ├── UserMessageTransferEntity.cs │ ├── UserNotificationSettingEntity.cs │ ├── UserPrivacySettingEntity.cs │ ├── UserProfileEntity.cs │ ├── UserRecoveryEntity.cs │ └── UserTokenEntity.cs ├── Migrations │ ├── 20220501212422_InitialCreate.Designer.cs │ ├── 20220501212422_InitialCreate.cs │ ├── 20220501215515_UseFluentApi.Designer.cs │ ├── 20220501215515_UseFluentApi.cs │ ├── 20220610024404_SplitTransferTables.Designer.cs │ ├── 20220610024404_SplitTransferTables.cs │ ├── 20220630020326_AddUserFailedLogin.Designer.cs │ ├── 20220630020326_AddUserFailedLogin.cs │ ├── 20220707212651_AddCompressionType.Designer.cs │ ├── 20220707212651_AddCompressionType.cs │ ├── 20221122013128_RemovedTransferSigning.Designer.cs │ ├── 20221122013128_RemovedTransferSigning.cs │ ├── 20221210051939_AddMasterKeyRecoveryKeyAndConsents.Designer.cs │ ├── 20221210051939_AddMasterKeyRecoveryKeyAndConsents.cs │ ├── 20221221040334_UseLongTransferSize.Designer.cs │ ├── 20221221040334_UseLongTransferSize.cs │ ├── 20230128214700_AddUniqueConstraintOnVerificationCode.Designer.cs │ ├── 20230128214700_AddUniqueConstraintOnVerificationCode.cs │ ├── 20230330183932_AddUserRecovery.Designer.cs │ ├── 20230330183932_AddUserRecovery.cs │ ├── 20230401184754_RemoveConsentActiveDefaultValue.Designer.cs │ ├── 20230401184754_RemoveConsentActiveDefaultValue.cs │ ├── 20230404213643_UseCrypterSchema.Designer.cs │ ├── 20230404213643_UseCrypterSchema.cs │ ├── 20240212170326_TransferNullablePublicKey.Designer.cs │ ├── 20240212170326_TransferNullablePublicKey.cs │ ├── 20240406224122_AddEventLogTable.Designer.cs │ ├── 20240406224122_AddEventLogTable.cs │ ├── 20240903144440_AddFileTransferPartsColumn.Designer.cs │ ├── 20240903144440_AddFileTransferPartsColumn.cs │ ├── 20250114045437_RenameUserConsentColumn.Designer.cs │ ├── 20250114045437_RenameUserConsentColumn.cs │ ├── 20250317181033_UserEmailChangeUpdates.Designer.cs │ ├── 20250317181033_UserEmailChangeUpdates.cs │ ├── 20250416024854_AddTransferTierTable.Designer.cs │ ├── 20250416024854_AddTransferTierTable.cs │ ├── 20250424020928_AddMaximumMessageLengthColumn.Designer.cs │ ├── 20250424020928_AddMaximumMessageLengthColumn.cs │ └── DataContextModelSnapshot.cs └── Scripts │ └── UserEmailChangeUpdates_Before.sql ├── Crypter.Test.Web ├── AssemblyInfo.cs ├── BrowserRepository_Tests.cs ├── BrowserTokenRepository_Tests.cs ├── BrowserUserSessionRepository_Tests.cs └── Crypter.Test.Web.csproj ├── Crypter.Test ├── AssemblyInfo.cs ├── AssemblySetup.cs ├── Common_Tests │ ├── Infrastructure_Tests │ │ ├── UrlSafeEncoder_Tests.cs │ │ └── VersionProvider_Tests.cs │ └── Primitive_Tests │ │ ├── AuthenticationPassword_Tests.cs │ │ ├── Base64String_Tests.cs │ │ ├── EmailAddress_Tests.cs │ │ ├── Password_Tests.cs │ │ └── Username_Tests.cs ├── ContainerService.cs ├── Container_Tests │ └── PostgresContainer_Tests.cs ├── Core_Tests │ ├── Features_Tests │ │ └── ApplicationAnalyticsReportQuery_Tests.cs │ ├── Identity_Tests │ │ └── EdDsa_Tests.cs │ └── Services_Tests │ │ ├── EmailService_Tests.cs │ │ ├── HangfireBackgroundService_Tests.cs │ │ ├── HashIdService_Tests.cs │ │ ├── PasswordHashService_Tests.cs │ │ ├── TokenService_Tests.cs │ │ └── TransferRepository_Tests.cs ├── Crypter.Test.csproj ├── Integration_Tests │ ├── FileTransfer_Tests │ │ ├── AbandonMultipartFileTransfer_Tests.cs │ │ ├── DownloadFileTransfer_Tests.cs │ │ ├── FinalizeMultipartFileTransfer_Tests.cs │ │ ├── GetReceivedFileTransfers_Tests.cs │ │ ├── GetSentFileTransfers_Tests.cs │ │ ├── InitiateMultipartFileTransfer_Tests.cs │ │ ├── PreviewFileTransfer_Tests.cs │ │ ├── UploadFileTransfer_Tests.cs │ │ └── UploadMultipartFileTransfer_Tests.cs │ ├── MessageTransfer_Tests │ │ ├── DownloadMessageTransfer_Tests.cs │ │ ├── GetReceivedMessageTransfers_Tests.cs │ │ ├── GetSentMessageTransfers_Tests.cs │ │ ├── PreviewMessageTransfer_Tests.cs │ │ └── UploadMessageTransfer_Tests.cs │ ├── Mocks.cs │ ├── TestData.cs │ ├── TestMethods.cs │ ├── UserAuthentication_Tests │ │ ├── Login_Tests.cs │ │ ├── Logout_Tests.cs │ │ ├── PasswordChallenge_Tests.cs │ │ ├── PasswordChange_Tests.cs │ │ ├── Refresh_Tests.cs │ │ └── Registration_Tests.cs │ ├── UserConsent_Tests │ │ └── RecoveryKeyRisksConsent_Tests.cs │ ├── UserContact_Tests │ │ ├── AddUserContact_Tests.cs │ │ ├── GetUserContact_Tests.cs │ │ └── RemoveUserContact_Tests.cs │ ├── UserKey_Tests │ │ ├── GetMasterKey_Tests.cs │ │ ├── GetPrivateKey_Tests.cs │ │ ├── GetRecoveryKey_Tests.cs │ │ ├── InsertMasterKey_Tests.cs │ │ └── InsertPrivateKey_Tests.cs │ ├── UserRecovery_Tests │ │ ├── SendRecoveryEmail_Tests.cs │ │ └── SubmitRecovery_Tests.cs │ ├── UserSettings_Tests │ │ ├── EmailAddressVerification_Tests.cs │ │ ├── GetContactInfo_Tests.cs │ │ ├── GetNotificationSettings_Tests.cs │ │ ├── GetPrivacySettings_Tests.cs │ │ ├── GetProfileSettings_Tests.cs │ │ ├── GetTransferSettings_Tests.cs │ │ ├── SetPrivacySettings_Tests.cs │ │ ├── SetProfileSettings_Tests.cs │ │ ├── UpdateContactInfo_Tests.cs │ │ └── UpdateNotificationSettings_Tests.cs │ ├── User_Tests │ │ ├── GetUserProfile_Tests.cs │ │ └── UserSearch_Tests.cs │ ├── Version_Tests │ │ └── GetApiVersion_Tests.cs │ └── WellKnown_Tests │ │ ├── GetJwks_Tests.cs │ │ └── GetOpenIdConfiguration_Tests.cs ├── SettingsReader.cs └── appsettings.Test.json ├── Crypter.Web ├── App.razor ├── Caddyfile ├── Client │ └── Program.cs ├── Crypter.Web.csproj ├── Dockerfile ├── Helpers │ └── ExtensionMethods.cs ├── Models │ ├── Forms │ │ ├── EmailVerificationParameters.cs │ │ ├── LoginForm.cs │ │ └── UserRegistrationForm.cs │ ├── Settings │ │ └── ClientSettings.cs │ ├── UserReceivedItem.cs │ └── UserSentItem.cs ├── Npm │ └── src │ │ ├── browser.ts │ │ ├── fileSaver │ │ ├── download.ts │ │ ├── fileSaver.ts │ │ ├── interfaces │ │ │ ├── dotNetStream.ts │ │ │ └── fileMetaData.ts │ │ ├── serviceWorker.noOp.ts │ │ └── serviceWorker.ts │ │ └── functions.ts ├── Pages │ ├── About.razor │ ├── AcceptableUsePolicy.razor │ ├── Authenticated │ │ ├── Base │ │ │ └── AuthenticatedPageBase.cs │ │ ├── Search.razor │ │ ├── Search.razor.cs │ │ ├── UserContacts.razor │ │ ├── UserContacts.razor.cs │ │ ├── UserSettings.razor │ │ ├── UserSettings.razor.cs │ │ ├── UserTransfers.razor │ │ └── UserTransfers.razor.cs │ ├── Contact.razor │ ├── DecryptFile.razor │ ├── DecryptFile.razor.cs │ ├── DecryptMessage.razor │ ├── DecryptMessage.razor.cs │ ├── ForgotPassword.razor │ ├── ForgotPassword.razor.cs │ ├── Index.razor │ ├── Login.razor │ ├── Login.razor.cs │ ├── PrivacyPolicy.razor │ ├── Recovery.razor │ ├── Recovery.razor.cs │ ├── Register.razor │ ├── UserProfile.razor │ ├── UserProfile.razor.cs │ ├── Verify.razor │ └── Verify.razor.cs ├── Properties │ ├── PublishProfiles │ │ └── FolderProfile.pubxml │ └── launchSettings.json ├── Repositories │ ├── BrowserRepository.cs │ ├── BrowserTokenRepository.cs │ ├── BrowserUserKeysRepository.cs │ └── BrowserUserSessionRepository.cs ├── Services │ ├── BrowserFunctions.cs │ ├── BrowserHttpMessageHandler.cs │ └── FileSaverService.cs ├── Shared │ ├── AppFooter.razor │ ├── AppFooter.razor.cs │ ├── AppFooter.razor.css │ ├── AppHeader.razor │ ├── AppHeader.razor.css │ ├── ItemNotFoundComponent.razor │ ├── LoginComponent.razor │ ├── LoginComponent.razor.cs │ ├── MainLayout.razor │ ├── MainLayout.razor.cs │ ├── MainLayout.razor.css │ ├── Modal │ │ ├── BasicModal.razor │ │ ├── BasicModal.razor.cs │ │ ├── PasswordChallengeModal.razor │ │ ├── PasswordChallengeModal.razor.cs │ │ ├── RecoveryKeyModal.razor │ │ ├── RecoveryKeyModal.razor.cs │ │ ├── SpinnerModal.razor │ │ ├── SpinnerModal.razor.cs │ │ ├── Template │ │ │ ├── ModalBehavior.razor │ │ │ └── ModalBehavior.razor.cs │ │ ├── TransferSuccessModal.razor │ │ ├── TransferSuccessModal.razor.cs │ │ ├── UploadFileTransferModal.razor │ │ ├── UploadFileTransferModal.razor.cs │ │ ├── UploadMessageTransferModal.razor │ │ └── UploadMessageTransferModal.razor.cs │ ├── Navigation.razor │ ├── Navigation.razor.cs │ ├── QuotaComponent.razor │ ├── QuotaComponent.razor.cs │ ├── RegisterComponent.razor │ ├── RegisterComponent.razor.cs │ ├── Transfer │ │ ├── DownloadFileTransfer.razor │ │ ├── DownloadFileTransfer.razor.cs │ │ ├── DownloadMessageTransfer.razor │ │ ├── DownloadMessageTransfer.razor.cs │ │ ├── DownloadTransferBase.cs │ │ ├── TabbedUploadTransferComponent.razor │ │ ├── TabbedUploadTransferComponent.razor.cs │ │ ├── TransferSettings.razor │ │ ├── TransferSettings.razor.cs │ │ ├── UploadFileTransfer.razor │ │ ├── UploadFileTransfer.razor.cs │ │ ├── UploadMessageTransfer.razor │ │ ├── UploadMessageTransfer.razor.cs │ │ └── UploadTransferBase.cs │ ├── UserReceivedItemsComponent.razor │ ├── UserReceivedItemsComponent.razor.cs │ ├── UserSentItemsComponent.razor │ ├── UserSentItemsComponent.razor.cs │ └── UserSettings │ │ ├── UserSettingsAccountInfo.razor │ │ ├── UserSettingsAccountInfo.razor.cs │ │ ├── UserSettingsKeys.razor │ │ ├── UserSettingsKeys.razor.cs │ │ ├── UserSettingsNotificationSettings.razor │ │ ├── UserSettingsNotificationSettings.razor.cs │ │ ├── UserSettingsPrivacySettings.razor │ │ ├── UserSettingsPrivacySettings.razor.cs │ │ ├── UserSettingsPublicDetails.razor │ │ └── UserSettingsPublicDetails.razor.cs ├── _Imports.razor ├── compilerconfig.json ├── compilerconfig.json.defaults ├── package.json ├── tsconfig.json ├── vite.fileSaver.config.js ├── vite.functions.config.js ├── vite.serviceWorker.config.js ├── vite.serviceWorker.noOp.config.js └── wwwroot │ ├── appsettings.Development.json │ ├── appsettings.Staging.json │ ├── appsettings.json │ ├── css │ ├── app.css │ ├── main.css │ ├── main.min.css │ ├── main.scss │ └── partials │ │ ├── _base.scss │ │ ├── _copied.scss │ │ ├── _decrypt.scss │ │ ├── _encrypt.scss │ │ ├── _input-group.scss │ │ ├── _navigation.scss │ │ └── _upload.scss │ ├── favicon.ico │ ├── img │ ├── GitHub-Mark-32px.png │ └── kofi_s_logo_nolabel.svg │ ├── index.html │ ├── js │ ├── blazorStartup.js │ └── scripts.js │ └── lib │ ├── bootstrap-5.2.3-dist │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-grid.rtl.css │ │ ├── bootstrap-grid.rtl.css.map │ │ ├── bootstrap-grid.rtl.min.css │ │ ├── bootstrap-grid.rtl.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap-reboot.rtl.css │ │ ├── bootstrap-reboot.rtl.css.map │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ ├── bootstrap-utilities.css │ │ ├── bootstrap-utilities.css.map │ │ ├── bootstrap-utilities.min.css │ │ ├── bootstrap-utilities.min.css.map │ │ ├── bootstrap-utilities.rtl.css │ │ ├── bootstrap-utilities.rtl.css.map │ │ ├── bootstrap-utilities.rtl.min.css │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── bootstrap.rtl.css │ │ ├── bootstrap.rtl.css.map │ │ ├── bootstrap.rtl.min.css │ │ └── bootstrap.rtl.min.css.map │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.esm.js │ │ ├── bootstrap.esm.js.map │ │ ├── bootstrap.esm.min.js │ │ ├── bootstrap.esm.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── bootstrap-icons-1.10.3 │ ├── bootstrap-icons.css │ ├── bootstrap-icons.json │ ├── bootstrap-icons.scss │ └── fonts │ │ ├── bootstrap-icons.woff │ │ └── bootstrap-icons.woff2 │ └── fonts-local │ └── google │ ├── Rubik.css │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FU0U1Z4Y.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FV0U1.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FVUU1Z4Y.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FWUU1Z4Y.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FWkU1Z4Y.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFU0U1Z4Y.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFV0U1.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFVUU1Z4Y.woff2 │ ├── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFWUU1Z4Y.woff2 │ └── iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFWkU1Z4Y.woff2 ├── Crypter.sln ├── Documentation ├── Development │ ├── Coding Standard.md │ └── Development Environment Setup.md ├── Learning Material.md └── Production │ ├── Deprecated │ ├── Crypter.API.md │ ├── Crypter.Web.md │ └── PostgreSQL.md │ └── Server Setup │ ├── File Size Limits.md │ └── Web Server Setup.md ├── Environments ├── production │ └── crypter.service └── staging │ └── crypter.service ├── LICENSE.md ├── README.md ├── Volumes ├── API │ └── appsettings.json └── PostgreSQL │ └── postgres-init-files │ └── init.sh ├── docker-compose.override.yml └── docker-compose.yml /.dockerignore: -------------------------------------------------------------------------------- 1 | # directories 2 | Documentation/ 3 | Environments/ 4 | Volumes/ 5 | 6 | .github/ 7 | .idea/ 8 | 9 | **/bin/ 10 | **/obj/ 11 | **/out/ 12 | 13 | # files 14 | .env 15 | Dockerfile* 16 | docker-compose* 17 | **/*.md 18 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | API_IMAGE_NAME="" 2 | API_SETTINGS_FILE=./Volumes/API/appsettings.json 3 | API_STORAGE_PATH=./Volumes/API/storage 4 | API_ASPNETCORE_ENVIRONMENT=Development 5 | CADDY_DOMAIN=localhost 6 | CADDY_REDIRECT_TO_WWW=127.0.0.1 7 | CADDY_OPTIONS="" 8 | CADDY_TLS_VOLUME=./Volumes/Caddy/tls 9 | CADDY_MAX_REQUEST_BODY=251MB 10 | POSTGRES_BIND_IP="" 11 | POSTGRES_HOST="" 12 | POSTGRES_HANGFIRE_HOST="" 13 | POSTGRES_USER_PASSWORD="" 14 | POSTGRES_HANGFIRE_USER_PASSWORD="" 15 | WEB_BIND_PORT=80 16 | WEB_IMAGE_NAME="" 17 | WEB_SECURE_BIND_PORT=443 18 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Crypter 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: crypter 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug to the team so we can fix it 4 | title: "[Bug] enter title here" 5 | labels: bug, triage 6 | assignees: Jack-Edwards 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Environment (please complete the following information):** 27 | - Device: [Desktop, Macbook Pro, Samsung Galaxy S21] 28 | - OS: [e.g. Windows 10 21H1, MacOS 12, Ubuntu 20.04] 29 | - Browser [e.g. Chrome 92.0.4515, Safari 14.1.2, Firefox 91.0] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Request a new feature or improvement from the team 4 | title: "[Feature] enter title here" 5 | labels: 'enhancement, triage' 6 | assignees: Jack-Edwards 7 | 8 | --- 9 | 10 | **Describe the feature** 11 | A clear and concise description of what is being requested. 12 | 13 | **Additional context** 14 | Add any other context about the request here. -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "nuget" 4 | directory: "/" 5 | target-branch: "stable" 6 | schedule: 7 | interval: "monthly" 8 | 9 | - package-ecosystem: "github-actions" 10 | directory: "/" 11 | target-branch: "stable" 12 | schedule: 13 | interval: "monthly" -------------------------------------------------------------------------------- /.github/workflows/pr-build-api.yml: -------------------------------------------------------------------------------- 1 | name: Build Crypter.API image 2 | 3 | on: 4 | pull_request: 5 | branches: [ main, stable ] 6 | 7 | jobs: 8 | build-api: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Docker Buildx 17 | uses: docker/setup-buildx-action@v3 18 | 19 | - name: Build image 20 | uses: docker/build-push-action@v6 21 | with: 22 | context: . 23 | file: ./Crypter.API/Dockerfile 24 | push: false 25 | -------------------------------------------------------------------------------- /.github/workflows/pr-build-web.yml: -------------------------------------------------------------------------------- 1 | name: Build Crypter.Web image 2 | 3 | on: 4 | pull_request: 5 | branches: [ main, stable ] 6 | 7 | jobs: 8 | build-web: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v4 15 | 16 | - name: Set up Docker Buildx 17 | uses: docker/setup-buildx-action@v3 18 | 19 | - name: Build image 20 | uses: docker/build-push-action@v6 21 | with: 22 | context: . 23 | file: ./Crypter.Web/Dockerfile 24 | push: false 25 | -------------------------------------------------------------------------------- /.github/workflows/unit-test.yml: -------------------------------------------------------------------------------- 1 | name: Unit test 2 | 3 | on: 4 | pull_request: 5 | branches: [ main, stable ] 6 | 7 | jobs: 8 | build-and-test: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | 14 | - uses: pnpm/action-setup@v4 15 | with: 16 | version: 9 17 | 18 | - name: Setup .NET 19 | uses: actions/setup-dotnet@v4 20 | with: 21 | dotnet-version: 9.0.x 22 | 23 | - name: Restore dependencies 24 | run: dotnet restore Crypter.Test 25 | 26 | - name: Build 27 | run: dotnet build Crypter.Test --configuration Release --no-restore 28 | 29 | - name: Test 30 | run: dotnet test Crypter.Test --configuration Release --no-build --verbosity normal 31 | 32 | build-and-test-web: 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - uses: actions/checkout@v4 37 | 38 | - uses: pnpm/action-setup@v4 39 | with: 40 | version: 9 41 | 42 | - name: Setup .NET 43 | uses: actions/setup-dotnet@v4 44 | with: 45 | dotnet-version: 9.0.x 46 | 47 | - name: Install wasm-tools 48 | run: dotnet workload install wasm-tools 49 | 50 | - name: Restore dependencies 51 | run: dotnet restore Crypter.Test.Web 52 | 53 | - name: Build 54 | run: dotnet build Crypter.Test.Web --configuration Release --no-restore 55 | 56 | - name: Test 57 | run: dotnet test Crypter.Test.Web --configuration Release --no-build --verbosity normal 58 | -------------------------------------------------------------------------------- /Crypter.API/.gitignore: -------------------------------------------------------------------------------- 1 | Volumes/* 2 | -------------------------------------------------------------------------------- /Crypter.API/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build 2 | ARG VCS_URL 3 | ENV VCS_URL=$VCS_URL 4 | WORKDIR /source/ 5 | 6 | RUN dotnet tool install --global dotnet-ef --version 9.0.* 7 | ENV PATH="${PATH}:/root/.dotnet/tools" 8 | 9 | COPY ../*.sln ./ 10 | COPY ../Crypter.API/*.csproj ./Crypter.API/ 11 | COPY ../Crypter.Common/*.csproj ./Crypter.Common/ 12 | COPY ../Crypter.Core/*.csproj ./Crypter.Core/ 13 | COPY ../Crypter.Crypto.Common/*.csproj ./Crypter.Crypto.Common/ 14 | COPY ../Crypter.Crypto.Providers.Default/*.csproj ./Crypter.Crypto.Providers.Default/ 15 | COPY ../Crypter.DataAccess/*.csproj ./Crypter.DataAccess/ 16 | 17 | RUN dotnet restore Crypter.API --runtime linux-x64 18 | 19 | COPY Crypter.API/. ./Crypter.API/ 20 | COPY Crypter.Common/. ./Crypter.Common/ 21 | COPY Crypter.Core/. ./Crypter.Core/ 22 | COPY Crypter.Crypto.Common/. ./Crypter.Crypto.Common/ 23 | COPY Crypter.Crypto.Providers.Default/. ./Crypter.Crypto.Providers.Default/ 24 | COPY Crypter.DataAccess/. ./Crypter.DataAccess/ 25 | COPY .git/. ./.git/ 26 | 27 | RUN dotnet publish Crypter.API --configuration release --no-self-contained /p:TreatWarningsAsErrors=true /warnaserror --output /app/ 28 | RUN dotnet-ef migrations bundle --project Crypter.DataAccess --startup-project Crypter.API --configuration release --no-build --target-runtime linux-x64 --output /app/efbundle --verbose 29 | 30 | FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime 31 | WORKDIR /app 32 | COPY --from=build /app ./ 33 | CMD ["dotnet", "Crypter.API.dll"] 34 | -------------------------------------------------------------------------------- /Crypter.API/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | true 8 | false 9 | true 10 | Release 11 | Any CPU 12 | FileSystem 13 | bin\Release\net7.0\publish\ 14 | FileSystem 15 | 16 | net7.0 17 | f9208a53-1847-4b7e-a867-c5d17f52410c 18 | true 19 | linux-x64 20 | true 21 | false 22 | 23 | -------------------------------------------------------------------------------- /Crypter.API/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:38294", 8 | "sslPort": 44357 9 | } 10 | }, 11 | "profiles": { 12 | "Crypter.API": { 13 | "commandName": "Project", 14 | "launchBrowser": true, 15 | "launchUrl": "api/swagger", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | }, 19 | "applicationUrl": "https://localhost:5003;http://localhost:5002" 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Crypter.API/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "TokenSettings": { 3 | "Audience": "localhost", 4 | "Issuer": "localhost" 5 | } 6 | } -------------------------------------------------------------------------------- /Crypter.Benchmarks/Assets/WindowsCodecsRaw.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Benchmarks/Assets/WindowsCodecsRaw.dll -------------------------------------------------------------------------------- /Crypter.Benchmarks/Config/AntivirusFriendlyConfig.cs: -------------------------------------------------------------------------------- 1 | using BenchmarkDotNet.Configs; 2 | using BenchmarkDotNet.Jobs; 3 | using BenchmarkDotNet.Toolchains.InProcess.NoEmit; 4 | 5 | namespace Crypter.Benchmarks.Config; 6 | 7 | public class AntiVirusFriendlyConfig : ManualConfig 8 | { 9 | public AntiVirusFriendlyConfig() 10 | { 11 | AddJob(Job.MediumRun.WithToolchain(InProcessNoEmitToolchain.Instance)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Crypter.Benchmarks/Crypter.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | disable 7 | enable 8 | true 9 | 12 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | PreserveNewest 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Crypter.Benchmarks/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Benchmarks; 28 | 29 | internal class Program 30 | { 31 | internal static void Main(string[] args) 32 | { 33 | //BenchmarkRunner.Run(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Crypter.Common.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | disable 6 | enable 7 | true 8 | 12 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Enums/BrowserStorageLocation.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Enums; 28 | 29 | public enum BrowserStorageLocation 30 | { 31 | Memory, 32 | SessionStorage, 33 | LocalStorage 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Enums/DeviceStorageObjectType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Enums; 28 | 29 | public enum DeviceStorageObjectType 30 | { 31 | UserSession, 32 | AuthenticationToken, 33 | RefreshToken, 34 | PrivateKey, 35 | MasterKey 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Enums/PasswordHashType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Enums; 28 | 29 | public enum PasswordHashType 30 | { 31 | AuthenticationKey, 32 | CredentialKey 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Enums/TransferTransmissionType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Enums; 28 | 29 | public enum TransferTransmissionType 30 | { 31 | Buffer, 32 | Stream, 33 | Multipart 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Events/EmitRecoveryKeyEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using Crypter.Common.Client.Models; 28 | 29 | namespace Crypter.Common.Client.Events; 30 | 31 | public sealed class EmitRecoveryKeyEventArgs 32 | { 33 | public RecoveryKey RecoveryKey { get; } 34 | 35 | public EmitRecoveryKeyEventArgs(RecoveryKey recoveryKey) 36 | { 37 | RecoveryKey = recoveryKey; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Events/PasswordHashEndEventArgs.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Events; 28 | 29 | public class PasswordHashEndEventArgs 30 | { 31 | public bool Success { get; init; } 32 | 33 | public PasswordHashEndEventArgs(bool success) 34 | { 35 | Success = success; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Interfaces/Requests/IVersionRequests.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using Crypter.Common.Contracts.Features.Version; 28 | using EasyMonads; 29 | using System.Threading.Tasks; 30 | 31 | namespace Crypter.Common.Client.Interfaces.Requests; 32 | 33 | public interface IVersionRequests 34 | { 35 | Task> GetApiVersionAsync(); 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Models/ClientApiSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Models; 28 | 29 | public class ClientApiSettings 30 | { 31 | public string ApiBaseUrl { get; set; } = string.Empty; 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Transfer/Handlers/Base/IUserDownloadHandler.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Transfer.Handlers.Base; 28 | 29 | public interface IUserDownloadHandler 30 | { 31 | void SetRecipientInfo(byte[] recipientPrivateKey); 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Common.Client/Transfer/Handlers/Base/IUserUploadHandler.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Client.Transfer.Handlers.Base; 28 | 29 | public interface IUserUploadHandler 30 | { 31 | void SetSenderInfo(byte[] privateKey); 32 | void SetRecipientInfo(string username, byte[] publicKey); 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/AccountRecovery/RequestRecovery/SendRecoveryEmailError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.AccountRecovery.RequestRecovery; 28 | 29 | public enum SendRecoveryEmailError 30 | { 31 | UnknownError, 32 | InvalidEmailAddress 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/AccountRecovery/SubmitRecovery/SubmitAccountRecoveryError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.AccountRecovery.SubmitRecovery; 28 | 29 | public enum SubmitAccountRecoveryError 30 | { 31 | UnknownError, 32 | InvalidUsername, 33 | InvalidPassword, 34 | RecoveryNotFound, 35 | WrongRecoveryKey, 36 | InvalidMasterKey, 37 | PasswordHashFailure, 38 | } 39 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Contacts/AddUserContactError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Contacts; 28 | 29 | public enum AddUserContactError 30 | { 31 | UnknownError, 32 | NotFound, 33 | InvalidUser 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Keys/GetMasterKey/GetMasterKeyError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Keys; 28 | 29 | public enum GetMasterKeyError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Keys/GetMasterKeyRecoveryProof/GetMasterKeyRecoveryProofError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Keys; 28 | 29 | public enum GetMasterKeyRecoveryProofError 30 | { 31 | UnknownError, 32 | NotFound, 33 | InvalidCredentials 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Keys/GetMasterKeyRecoveryProof/GetMasterKeyRecoveryProofResponse.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Keys; 28 | 29 | public class GetMasterKeyRecoveryProofResponse 30 | { 31 | public byte[] Proof { get; init; } 32 | 33 | public GetMasterKeyRecoveryProofResponse(byte[] proof) 34 | { 35 | Proof = proof; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Keys/GetPrivateKey/GetPrivateKeyError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Keys; 28 | 29 | public enum GetPrivateKeyError 30 | { 31 | UnkownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Keys/InsertKeyPair/InsertKeyPairError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Keys; 28 | 29 | public enum InsertKeyPairError 30 | { 31 | UnknownError, 32 | KeyPairAlreadyExists 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Keys/InsertMasterKey/InsertMasterKeyError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Keys; 28 | 29 | public enum InsertMasterKeyError 30 | { 31 | UnknownError, 32 | Conflict, 33 | InvalidPassword, 34 | InvalidMasterKey 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Transfer/Delete/AbandonMultipartFileTransferError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Transfer; 28 | 29 | public enum AbandonMultipartFileTransferError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Transfer/DownloadCiphertext/DownloadTransferCiphertextError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Transfer; 28 | 29 | public enum DownloadTransferCiphertextError 30 | { 31 | UnknownError, 32 | NotFound, 33 | InvalidRecipientProof 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Transfer/Preview/TransferPreviewError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Transfer; 28 | 29 | public enum TransferPreviewError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Transfer/Upload/FinalizeMultipartFileTransferError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Transfer; 28 | 29 | public enum FinalizeMultipartFileTransferError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Transfer/Upload/UploadMultipartFileTransferError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Transfer; 28 | 29 | public enum UploadMultipartFileTransferError 30 | { 31 | UnknownError, 32 | OutOfSpace, 33 | NotFound, 34 | AggregateTooLarge 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Transfer/Upload/UploadTransferError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Transfer; 28 | 29 | public enum UploadTransferError 30 | { 31 | UnknownError, 32 | InvalidRequestedLifetimeHours, 33 | OutOfSpace, 34 | RecipientNotFound, 35 | TooLarge 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserAuthentication/Logout/LogoutError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserAuthentication; 28 | 29 | public enum LogoutError 30 | { 31 | UnknownError, 32 | InvalidToken 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserAuthentication/PasswordChallenge/PasswordChallengeError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserAuthentication; 28 | 29 | public enum PasswordChallengeError 30 | { 31 | UnknownError, 32 | InvalidPassword, 33 | PasswordNeedsMigration, 34 | PasswordHashFailure 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserAuthentication/PasswordChange/PasswordChangeError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserAuthentication.PasswordChange; 28 | 29 | public enum PasswordChangeError 30 | { 31 | UnknownError, 32 | InvalidPassword, 33 | InvalidOldPasswordVersion, 34 | InvalidNewPasswordVersion, 35 | PasswordHashFailure 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserAuthentication/Refresh/RefreshError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserAuthentication; 28 | 29 | public enum RefreshError 30 | { 31 | UnknownError, 32 | UserNotFound, 33 | InvalidToken 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserConsents/UserConsentType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserConsents; 28 | 29 | public enum UserConsentType 30 | { 31 | 32 | TermsOfService, 33 | PrivacyPolicy, 34 | RecoveryKeyRisks 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/ContactInfoSettings/GetContactInfoSettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.ContactInfoSettings; 28 | 29 | public enum GetContactInfoSettingsError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/NotificationSettings/GetNotificationSettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.NotificationSettings; 28 | 29 | public enum GetNotificationSettingsError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/NotificationSettings/UpdateNotificationSettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.NotificationSettings; 28 | 29 | public enum UpdateNotificationSettingsError 30 | { 31 | UnknownError 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/PrivacySettings/GetPrivacySettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.PrivacySettings; 28 | 29 | public enum GetPrivacySettingsError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/PrivacySettings/SetPrivacySettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.PrivacySettings; 28 | 29 | public enum SetPrivacySettingsError 30 | { 31 | UnknownError 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/ProfileSettings/GetProfileSettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.ProfileSettings; 28 | 29 | public enum GetProfileSettingsError 30 | { 31 | UnknownError, 32 | NotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/ProfileSettings/SetProfileSettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.ProfileSettings; 28 | 29 | public enum SetProfileSettingsError 30 | { 31 | UnknownError 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/TransferSettings/GetTransferSettingsError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings.TransferSettings; 28 | 29 | public enum GetTransferSettingsError 30 | { 31 | UnknownError, 32 | TransferTierNotFound 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/UserSettings/VerifyEmailAddress/VerifyEmailAddressError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.UserSettings; 28 | 29 | public enum VerifyEmailAddressError 30 | { 31 | NotFound 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/Features/Users/GetUserProfile/GetUserProfileError.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts.Features.Users; 28 | 29 | public enum GetUserProfileError 30 | { 31 | NotFound 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Common/Contracts/InfrastructureErrorCodes.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Contracts; 28 | 29 | public enum InfrastructureErrorCode 30 | { 31 | UnknownErrorCode = 100, 32 | InvalidModelStateErrorCode = 101, 33 | InvalidEnumValueErrorCode = 102 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Common/Crypter.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | true 5 | enable 6 | 12 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Crypter.Common/Enums/TokenType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Text.Json.Serialization; 28 | using Crypter.Common.Infrastructure; 29 | 30 | namespace Crypter.Common.Enums; 31 | 32 | [JsonConverter(typeof(JsonEnumConverter))] 33 | public enum TokenType 34 | { 35 | Authentication, 36 | Session, 37 | Device 38 | } 39 | -------------------------------------------------------------------------------- /Crypter.Common/Enums/TransferItemType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Text.Json.Serialization; 28 | using Crypter.Common.Infrastructure; 29 | 30 | namespace Crypter.Common.Enums; 31 | 32 | [JsonConverter(typeof(JsonEnumConverter))] 33 | public enum TransferItemType 34 | { 35 | Message, 36 | File 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Common/Enums/TransferUserType.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Text.Json.Serialization; 28 | using Crypter.Common.Infrastructure; 29 | 30 | namespace Crypter.Common.Enums; 31 | 32 | [JsonConverter(typeof(JsonEnumConverter))] 33 | public enum TransferUserType 34 | { 35 | Anonymous, 36 | User 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Common/Enums/UserCategory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Text.Json.Serialization; 28 | using Crypter.Common.Infrastructure; 29 | 30 | namespace Crypter.Common.Enums; 31 | 32 | [JsonConverter(typeof(JsonEnumConverter))] 33 | public enum UserCategory 34 | { 35 | Unknown, 36 | Anonymous, 37 | Authenticated, 38 | Verified 39 | } 40 | -------------------------------------------------------------------------------- /Crypter.Common/Enums/UserVisibilityLevel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Text.Json.Serialization; 28 | using Crypter.Common.Infrastructure; 29 | 30 | namespace Crypter.Common.Enums; 31 | 32 | [JsonConverter(typeof(JsonEnumConverter))] 33 | public enum UserVisibilityLevel 34 | { 35 | None, 36 | Contacts, 37 | Authenticated, 38 | Everyone 39 | } 40 | -------------------------------------------------------------------------------- /Crypter.Common/Exceptions/ConfigurationException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Common.Exceptions; 30 | 31 | public class ConfigurationException : Exception 32 | { 33 | public ConfigurationException(string message) : base(message) 34 | { } 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Common/Exceptions/InvalidTokenException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Common.Exceptions; 30 | 31 | public class InvalidTokenException : ApplicationException 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Exceptions/NotInitializedException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Common.Exceptions; 30 | 31 | public class NotInitializedException : ApplicationException 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Infrastructure/InvalidEnumValueException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Common.Infrastructure; 30 | 31 | public class InvalidEnumValueException : ApplicationException 32 | { 33 | public InvalidEnumValueException(string value, Type enumType) 34 | : base($"'{value}' is not a valid value for {enumType.Name}") 35 | { 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Enums/ByteArrayPrimitiveValidationFailure.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Primitives.Enums; 28 | 29 | public enum ByteArrayPrimitiveValidationFailure 30 | { 31 | Invalid, 32 | IsNull, 33 | IsEmpty, 34 | TooLong, 35 | TooShort 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Enums/StringPrimitiveValidationFailure.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Primitives.Enums; 28 | 29 | public enum StringPrimitiveValidationFailure 30 | { 31 | Invalid, 32 | IsNull, 33 | IsEmpty, 34 | TooLong, 35 | TooShort, 36 | InvalidCharacters 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Exceptions/ValueContainsInvalidCharactersException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Primitives.Exceptions; 28 | 29 | public class ValueContainsInvalidCharactersException : ValueInvalidException 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Exceptions/ValueEmptyException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Primitives.Exceptions; 28 | 29 | public class ValueEmptyException : ValueInvalidException 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Exceptions/ValueInvalidException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Common.Primitives.Exceptions; 30 | 31 | public class ValueInvalidException : ApplicationException 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Exceptions/ValueNullException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Primitives.Exceptions; 28 | 29 | public class ValueNullException : ValueInvalidException 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Exceptions/ValueTooLongException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Primitives.Exceptions; 28 | 29 | public class ValueTooLongException : ValueInvalidException 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Crypter.Common/Primitives/Exceptions/ValueTooShortException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Common.Primitives.Exceptions; 28 | 29 | public class ValueTooShortException : ValueInvalidException 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Crypter.Core/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Core; 28 | 29 | public class AssemblyInfo 30 | { } 31 | -------------------------------------------------------------------------------- /Crypter.Core/Crypter.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | disable 7 | true 8 | 12 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Crypter.Core/Exceptions/HangfireJobException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Core.Exceptions; 30 | 31 | public class HangfireJobException : Exception 32 | { 33 | public HangfireJobException(string message) : base(message) 34 | { } 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Core/Features/UserConsent/Commands/SaveUserConsentCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using Crypter.Common.Contracts.Features.UserConsents; 5 | using Crypter.DataAccess; 6 | using Crypter.DataAccess.Entities; 7 | using MediatR; 8 | using Unit = EasyMonads.Unit; 9 | 10 | namespace Crypter.Core.Features.UserConsent.Commands; 11 | 12 | public record SaveUserConsentCommand(Guid UserId, UserConsentType ConsentType) 13 | : IRequest; 14 | 15 | internal sealed class SaveUserConsentCommandHandler 16 | : IRequestHandler 17 | { 18 | private readonly DataContext _dataContext; 19 | 20 | public SaveUserConsentCommandHandler(DataContext dataContext) 21 | { 22 | _dataContext = dataContext; 23 | } 24 | 25 | public async Task Handle(SaveUserConsentCommand request, CancellationToken _) 26 | { 27 | UserConsentEntity newConsent = new UserConsentEntity(request.UserId, request.ConsentType, true, DateTime.UtcNow); 28 | _dataContext.UserConsents.Add(newConsent); 29 | await _dataContext.SaveChangesAsync(CancellationToken.None); 30 | return Unit.Default; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Core/Identity/PasswordVersion.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Core.Identity; 28 | 29 | public class PasswordVersion 30 | { 31 | public required short Version { get; set; } 32 | public required string Algorithm { get; set; } 33 | public required int Iterations { get; set; } 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Core/Identity/ServerPasswordSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Collections.Generic; 28 | 29 | namespace Crypter.Core.Identity; 30 | 31 | public class ServerPasswordSettings 32 | { 33 | public required short ClientVersion { get; set; } 34 | public required List ServerVersions { get; set; } 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Core/MediatorMonads/IEitherRequest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using EasyMonads; 28 | using MediatR; 29 | 30 | namespace Crypter.Core.MediatorMonads; 31 | 32 | public interface IEitherRequest : IRequest> 33 | { } 34 | 35 | public interface IEitherRequestHandler : IRequestHandler> 36 | where TRequest : IRequest> 37 | { } 38 | -------------------------------------------------------------------------------- /Crypter.Core/MediatorMonads/IMaybeRequest.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using EasyMonads; 28 | using MediatR; 29 | 30 | namespace Crypter.Core.MediatorMonads; 31 | 32 | public interface IMaybeRequest : IRequest> 33 | { } 34 | 35 | public interface IMaybeRequestHandler : IRequestHandler> 36 | where TRequest : IRequest> 37 | { } 38 | -------------------------------------------------------------------------------- /Crypter.Core/Services/TransferOwnershipService.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | using EasyMonads; 29 | 30 | namespace Crypter.Core.Services; 31 | 32 | internal static class TransferOwnershipService 33 | { 34 | public static Maybe GetTransferOwner(Maybe senderId, Maybe recipientId) 35 | { 36 | return recipientId.IsSome 37 | ? recipientId 38 | : senderId; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Crypter.Core/Settings/AnalyticsSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Core.Settings; 30 | 31 | public class AnalyticsSettings 32 | { 33 | public required bool EnableEmailedReports { get; set; } = false; 34 | public string? ReportRecipientEmailAddress { get; set; } 35 | public DayOfWeek? DayOfWeek { get; set; } 36 | public int? Hour { get; set; } 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Core/Settings/CorsSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Collections.Generic; 28 | 29 | namespace Crypter.Core.Settings; 30 | 31 | public class CorsSettings 32 | { 33 | public required List AllowedOrigins { get; init; } 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Core/Settings/DatabaseSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Core.Settings; 28 | 29 | public class DatabaseSettings 30 | { 31 | public required bool MigrateOnStartup { get; set; } 32 | public required bool SeedOnStartup { get; set; } 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Core/Settings/HangfireSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Core.Settings; 28 | 29 | public class HangfireSettings 30 | { 31 | public required int Workers { get; set; } 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Core/Settings/HashIdSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Core.Settings; 28 | 29 | public class HashIdSettings 30 | { 31 | public required string Salt { get; set; } 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Core/Settings/TransferStorageSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Core.Settings; 28 | 29 | public class TransferStorageSettings 30 | { 31 | public required string Location { get; set; } 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/ConstantTime/IConstantTime.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Crypto.Common.ConstantTime; 30 | 31 | public interface IConstantTime 32 | { 33 | bool Equals(ReadOnlySpan left, ReadOnlySpan right); 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/Crypter.Crypto.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | disable 6 | enable 7 | true 8 | 12 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/CryptoHash/CryptoHash.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Security.Cryptography; 28 | 29 | namespace Crypter.Crypto.Common.CryptoHash; 30 | 31 | public class CryptoHash : ICryptoHash 32 | { 33 | public byte[] GenerateSha512(byte[] input) 34 | { 35 | return SHA512.HashData(input); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/CryptoHash/ICryptoHash.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Crypto.Common.CryptoHash; 28 | 29 | public interface ICryptoHash 30 | { 31 | byte[] GenerateSha512(byte[] input); 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/GenericHash/IGenericHash.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Crypto.Common.GenericHash; 30 | 31 | public interface IGenericHash 32 | { 33 | uint KeySize { get; } 34 | byte[] GenerateHash(uint size, ReadOnlySpan data, ReadOnlySpan key = default); 35 | byte[] GenerateHash(uint size, string data, ReadOnlySpan key = default); 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/Padding/IPadding.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Crypto.Common.Padding; 30 | 31 | public interface IPadding 32 | { 33 | byte[] Pad(ReadOnlySpan block, int blockSize); 34 | byte[] Unpad(ReadOnlySpan block, int blockSize); 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/PasswordHash/MemLimit.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Crypto.Common.PasswordHash; 28 | 29 | public enum MemLimit 30 | { 31 | Minimum, 32 | Interactive, 33 | Moderate, 34 | Sensitive, 35 | Maximum 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/PasswordHash/OpsLimit.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Crypto.Common.PasswordHash; 28 | 29 | public enum OpsLimit 30 | { 31 | Minimum, 32 | Interactive, 33 | Moderate, 34 | Sensitive, 35 | Maximum 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/Random/IRandom.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Crypto.Common.Random; 28 | 29 | public interface IRandom 30 | { 31 | uint GenerateRandomNumber(); 32 | byte[] GenerateRandomBytes(int size); 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/StreamEncryption/IStreamDecrypt.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Crypto.Common.StreamEncryption; 30 | 31 | public interface IStreamDecrypt 32 | { 33 | uint KeySize { get; } 34 | uint TagSize { get; } 35 | byte[] Pull(ReadOnlySpan ciphertext, int paddingBlockSize, out bool final); 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/StreamEncryption/IStreamEncrypt.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Crypto.Common.StreamEncryption; 30 | 31 | public interface IStreamEncrypt 32 | { 33 | uint KeySize { get; } 34 | uint TagSize { get; } 35 | byte[] GenerateHeader(ReadOnlySpan key); 36 | byte[] Push(byte[] plaintext, bool final); 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/StreamGenericHash/IStreamGenericHash.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System; 28 | 29 | namespace Crypter.Crypto.Common.StreamGenericHash; 30 | 31 | public interface IStreamGenericHash 32 | { 33 | void Update(ReadOnlySpan data); 34 | byte[] Complete(); 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.Crypto.Common/StreamGenericHash/IStreamGenericHashFactory.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Crypto.Common.StreamGenericHash; 28 | 29 | public interface IStreamGenericHashFactory 30 | { 31 | uint KeySize { get; } 32 | IStreamGenericHash NewGenericHashStream(uint hashLength, byte[] key); 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Crypto.Providers.Browser/Crypter.Crypto.Providers.Browser.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | disable 6 | enable 7 | true 8 | 12 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Crypter.Crypto.Providers.Browser/Wrappers/CryptoHash.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using System.Security.Cryptography; 28 | using Crypter.Crypto.Common.CryptoHash; 29 | 30 | namespace Crypter.Crypto.Providers.Browser.Wrappers; 31 | 32 | public class CryptoHash : ICryptoHash 33 | { 34 | public byte[] GenerateSha512(byte[] input) 35 | { 36 | return SHA512.HashData(input); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Crypter.Crypto.Providers.Default/Crypter.Crypto.Providers.Default.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | disable 6 | enable 7 | true 8 | 12 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Crypter.DataAccess.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 12 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/Interfaces/IMessageTransfer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.DataAccess.Entities.Interfaces; 28 | 29 | public interface IMessageTransfer : ITransferBase 30 | { 31 | string Subject { get; set; } 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/Interfaces/IUserPublicKeyPair.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.DataAccess.Entities.Interfaces; 28 | 29 | public interface IUserPublicKeyPair 30 | { 31 | public Guid Owner { get; set; } 32 | public byte[] PrivateKey { get; set; } 33 | public byte[] PublicKey { get; set; } 34 | public byte[] Nonce { get; set; } 35 | public DateTime Created { get; set; } 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/Interfaces/IUserTransfer.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.DataAccess.Entities.Interfaces; 28 | 29 | public interface IUserTransfer : ITransferBase 30 | { 31 | Guid? SenderId { get; set; } 32 | Guid? RecipientId { get; set; } 33 | public UserEntity? Sender { get; set; } 34 | public UserEntity? Recipient { get; set; } 35 | } 36 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/JsonTypes/EventLogAdditionalData/SuccessfulMultipartTransferAbandonAdditionalData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using Crypter.Common.Enums; 28 | 29 | namespace Crypter.DataAccess.Entities.JsonTypes.EventLogAdditionalData; 30 | 31 | public sealed record SuccessfulMultipartTransferAbandonAdditionalData( 32 | Guid ItemId, 33 | TransferItemType ItemType); 34 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/JsonTypes/EventLogAdditionalData/SuccessfulMultipartTransferFinalizationAdditionalData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using Crypter.Common.Enums; 28 | 29 | namespace Crypter.DataAccess.Entities.JsonTypes.EventLogAdditionalData; 30 | 31 | public sealed record SuccessfulMultipartTransferFinalizationAdditionalData( 32 | Guid ItemId, 33 | TransferItemType ItemType); 34 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/JsonTypes/EventLogAdditionalData/SuccessfulMultipartTransferUploadAdditionalData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using Crypter.Common.Enums; 28 | 29 | namespace Crypter.DataAccess.Entities.JsonTypes.EventLogAdditionalData; 30 | 31 | public sealed record SuccessfulMultipartTransferUploadAdditionalData( 32 | Guid ItemId, 33 | TransferItemType ItemType); 34 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/JsonTypes/EventLogAdditionalData/SuccessfulUserLoginAdditionalData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.DataAccess.Entities.JsonTypes.EventLogAdditionalData; 28 | 29 | public sealed record SuccessfulUserLoginAdditionalData( 30 | Guid UserId, 31 | string DeviceDescription); 32 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Entities/JsonTypes/EventLogAdditionalData/SuccessfulUserRegistrationAdditionalData.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.DataAccess.Entities.JsonTypes.EventLogAdditionalData; 28 | 29 | public sealed record SuccessfulUserRegistrationAdditionalData( 30 | Guid UserId, 31 | string? EmailAddress, 32 | string DeviceDescription); 33 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Migrations/20220630020326_AddUserFailedLogin.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | using System; 3 | 4 | #nullable disable 5 | 6 | namespace Crypter.DataAccess.Migrations 7 | { 8 | public partial class AddUserFailedLogin : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.CreateTable( 13 | name: "UserFailedLogin", 14 | columns: table => new 15 | { 16 | Id = table.Column(type: "uuid", nullable: false), 17 | Owner = table.Column(type: "uuid", nullable: false), 18 | Date = table.Column(type: "timestamp with time zone", nullable: false) 19 | }, 20 | constraints: table => 21 | { 22 | table.PrimaryKey("PK_UserFailedLogin", x => x.Id); 23 | table.ForeignKey( 24 | name: "FK_UserFailedLogin_User_Owner", 25 | column: x => x.Owner, 26 | principalTable: "User", 27 | principalColumn: "Id", 28 | onDelete: ReferentialAction.Cascade); 29 | }); 30 | 31 | migrationBuilder.CreateIndex( 32 | name: "IX_UserFailedLogin_Owner", 33 | table: "UserFailedLogin", 34 | column: "Owner"); 35 | } 36 | 37 | protected override void Down(MigrationBuilder migrationBuilder) 38 | { 39 | migrationBuilder.DropTable( 40 | name: "UserFailedLogin"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Migrations/20230128214700_AddUniqueConstraintOnVerificationCode.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Crypter.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class AddUniqueConstraintOnVerificationCode : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.CreateIndex( 14 | name: "IX_UserEmailVerification_Code", 15 | table: "UserEmailVerification", 16 | column: "Code", 17 | unique: true); 18 | } 19 | 20 | /// 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.DropIndex( 24 | name: "IX_UserEmailVerification_Code", 25 | table: "UserEmailVerification"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Migrations/20230401184754_RemoveConsentActiveDefaultValue.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Crypter.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class RemoveConsentActiveDefaultValue : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AlterColumn( 14 | name: "Active", 15 | table: "UserConsent", 16 | type: "boolean", 17 | nullable: false, 18 | oldClrType: typeof(bool), 19 | oldType: "boolean", 20 | oldDefaultValue: true); 21 | } 22 | 23 | /// 24 | protected override void Down(MigrationBuilder migrationBuilder) 25 | { 26 | migrationBuilder.AlterColumn( 27 | name: "Active", 28 | table: "UserConsent", 29 | type: "boolean", 30 | nullable: false, 31 | defaultValue: true, 32 | oldClrType: typeof(bool), 33 | oldType: "boolean"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Migrations/20240903144440_AddFileTransferPartsColumn.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Crypter.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class AddFileTransferPartsColumn : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "Parts", 15 | schema: "crypter", 16 | table: "UserFileTransfer", 17 | type: "boolean", 18 | nullable: false, 19 | defaultValue: false); 20 | 21 | migrationBuilder.AddColumn( 22 | name: "Parts", 23 | schema: "crypter", 24 | table: "AnonymousFileTransfer", 25 | type: "boolean", 26 | nullable: false, 27 | defaultValue: false); 28 | } 29 | 30 | /// 31 | protected override void Down(MigrationBuilder migrationBuilder) 32 | { 33 | migrationBuilder.DropColumn( 34 | name: "Parts", 35 | schema: "crypter", 36 | table: "UserFileTransfer"); 37 | 38 | migrationBuilder.DropColumn( 39 | name: "Parts", 40 | schema: "crypter", 41 | table: "AnonymousFileTransfer"); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Migrations/20250114045437_RenameUserConsentColumn.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Crypter.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class RenameUserConsentColumn : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.RenameColumn( 14 | name: "Created", 15 | schema: "crypter", 16 | table: "UserConsent", 17 | newName: "Activated"); 18 | } 19 | 20 | /// 21 | protected override void Down(MigrationBuilder migrationBuilder) 22 | { 23 | migrationBuilder.RenameColumn( 24 | name: "Activated", 25 | schema: "crypter", 26 | table: "UserConsent", 27 | newName: "Created"); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Migrations/20250424020928_AddMaximumMessageLengthColumn.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace Crypter.DataAccess.Migrations 6 | { 7 | /// 8 | public partial class AddMaximumMessageLengthColumn : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "MaximumMessageLength", 15 | schema: "crypter", 16 | table: "TransferTier", 17 | type: "integer", 18 | nullable: false, 19 | defaultValue: 0); 20 | 21 | migrationBuilder.UpdateData( 22 | schema: "crypter", 23 | table: "TransferTier", 24 | keyColumn: "Id", 25 | keyValues: [1, 2, 3], 26 | column: "MaximumMessageLength", 27 | values: [1024, 4096, 4096]); 28 | } 29 | 30 | /// 31 | protected override void Down(MigrationBuilder migrationBuilder) 32 | { 33 | migrationBuilder.DropColumn( 34 | name: "MaximumMessageLength", 35 | schema: "crypter", 36 | table: "TransferTier"); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Crypter.DataAccess/Scripts/UserEmailChangeUpdates_Before.sql: -------------------------------------------------------------------------------- 1 | -- Run this script before running the 20250317181033_UserEmailChangeUpdates migration. 2 | 3 | UPDATE crypter."User" 4 | SET "EmailAddress" = null 5 | WHERE "EmailVerified" = false; -------------------------------------------------------------------------------- /Crypter.Test.Web/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using NUnit.Framework; 28 | 29 | [assembly: NonParallelizable] 30 | -------------------------------------------------------------------------------- /Crypter.Test.Web/Crypter.Test.Web.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | disable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Crypter.Test/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | using NUnit.Framework; 28 | 29 | [assembly: NonParallelizable] 30 | -------------------------------------------------------------------------------- /Crypter.Web/Caddyfile: -------------------------------------------------------------------------------- 1 | {$CADDY_DOMAIN} { 2 | {$CADDY_OPTIONS} 3 | 4 | log { 5 | output file /var/log/caddy 6 | format console 7 | } 8 | 9 | handle /api/* { 10 | request_body { 11 | max_size {$CADDY_MAX_REQUEST_BODY} 12 | } 13 | 14 | reverse_proxy {$CRYPTER_API_BASE} 15 | } 16 | 17 | handle /.well-known/* { 18 | reverse_proxy {$CRYPTER_API_BASE} 19 | } 20 | 21 | handle /serviceWorker { 22 | root * /srv 23 | rewrite * js/dist/serviceWorker/serviceWorker.js 24 | 25 | file_server { 26 | precompressed br gzip 27 | } 28 | 29 | header { 30 | Service-Worker-Allowed "/" 31 | Service-Worker "script" 32 | } 33 | } 34 | 35 | handle /serviceWorker.noOp { 36 | root * /srv 37 | rewrite * js/dist/serviceWorker.noOp/serviceWorker.noOp.js 38 | 39 | file_server { 40 | precompressed br gzip 41 | } 42 | 43 | header { 44 | Service-Worker-Allowed "/" 45 | Service-Worker "script" 46 | } 47 | } 48 | 49 | handle { 50 | root * /srv 51 | try_files {path} /index.html 52 | 53 | header ?Content-Type "application/octet-stream" 54 | 55 | file_server { 56 | precompressed br gzip 57 | } 58 | } 59 | } 60 | 61 | {$CADDY_REDIRECT_TO_WWW} { 62 | redir https://www.{host}{uri} permanent 63 | } -------------------------------------------------------------------------------- /Crypter.Web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build 2 | ARG VCS_URL 3 | ENV VCS_URL=$VCS_URL 4 | 5 | WORKDIR /source/ 6 | 7 | SHELL ["/bin/bash", "-c"] 8 | 9 | RUN apt-get update -yq && apt-get upgrade -yq && apt-get install -yq curl git nano 10 | RUN curl -fsSL https://deb.nodesource.com/setup_21.x | bash - && apt-get install -yq nodejs 11 | RUN npm install --global pnpm \ 12 | && SHELL=bash pnpm setup \ 13 | && source /root/.bashrc 14 | 15 | COPY ../*.sln . 16 | COPY ../Crypter.Common/*.csproj ./Crypter.Common/ 17 | COPY ../Crypter.Common.Client/*.csproj ./Crypter.Common.Client/ 18 | COPY ../Crypter.Crypto.Common/*.csproj ./Crypter.Crypto.Common/ 19 | COPY ../Crypter.Crypto.Providers.Browser/*.csproj ./Crypter.Crypto.Providers.Browser/ 20 | COPY ../Crypter.Web/*.csproj ./Crypter.Web/ 21 | 22 | RUN dotnet restore Crypter.Web 23 | 24 | COPY Crypter.Common/. ./Crypter.Common/ 25 | COPY Crypter.Common.Client/. ./Crypter.Common.Client/ 26 | COPY Crypter.Crypto.Common/. ./Crypter.Crypto.Common/ 27 | COPY Crypter.Crypto.Providers.Browser/. ./Crypter.Crypto.Providers.Browser/ 28 | COPY Crypter.Web/. ./Crypter.Web/ 29 | COPY .git/. ./.git/ 30 | 31 | RUN dotnet workload install wasm-tools 32 | RUN dotnet publish Crypter.Web --no-restore --configuration release /p:TreatWarningsAsErrors=true /warnaserror --output /app/ 33 | 34 | FROM caddy:2.9-alpine AS webhost 35 | COPY Crypter.Web/Caddyfile /etc/caddy/Caddyfile 36 | COPY --from=build /app/wwwroot/ /srv/ 37 | EXPOSE 80 38 | EXPOSE 443 39 | -------------------------------------------------------------------------------- /Crypter.Web/Models/Forms/EmailVerificationParameters.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Web.Models.Forms; 28 | 29 | public class EmailVerificationParameters 30 | { 31 | public string Code { get; set; } = string.Empty; 32 | public string Signature { get; set; } = string.Empty; 33 | } 34 | -------------------------------------------------------------------------------- /Crypter.Web/Models/Forms/LoginForm.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Web.Models.Forms; 28 | 29 | public class LoginForm 30 | { 31 | public string Username { get; set; } = string.Empty; 32 | public string Password { get; set; } = string.Empty; 33 | public bool RememberMe { get; set; } 34 | } 35 | -------------------------------------------------------------------------------- /Crypter.Web/Npm/src/fileSaver/interfaces/dotNetStream.ts: -------------------------------------------------------------------------------- 1 | export default interface DotNetStream { 2 | stream() : Promise; 3 | arrayBuffer() : Promise; 4 | } 5 | -------------------------------------------------------------------------------- /Crypter.Web/Npm/src/fileSaver/interfaces/fileMetaData.ts: -------------------------------------------------------------------------------- 1 | export default interface FileMetaData { 2 | name: string; 3 | mimeType: string; 4 | size: number | undefined; 5 | } -------------------------------------------------------------------------------- /Crypter.Web/Npm/src/fileSaver/serviceWorker.noOp.ts: -------------------------------------------------------------------------------- 1 | self.addEventListener('install', () => { 2 | // Skip over the "waiting" lifecycle state, to ensure that our 3 | // new service worker is activated immediately, even if there's 4 | // another tab open controlled by our older service worker code. 5 | void (self as any).skipWaiting(); 6 | }); 7 | -------------------------------------------------------------------------------- /Crypter.Web/Npm/src/functions.ts: -------------------------------------------------------------------------------- 1 | export function browserSupportsRequestStreaming(): boolean { 2 | let support = false; 3 | if (browserImplementsRequestStreaming()) { 4 | // Test for Chromium bugfix: https://issues.chromium.org/issues/339788214 5 | const chromiumBugfixVersion = 130; 6 | let match: RegExpMatchArray | null = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); 7 | support = match 8 | ? parseInt(match[2], 10) > chromiumBugfixVersion 9 | : true; // Browser is not Chromium and is not subject to the bug 10 | } 11 | console.log(`Browser supports request streaming: ${support}`) 12 | return support; 13 | } 14 | 15 | function browserImplementsRequestStreaming() : boolean{ 16 | let duplexAccessed = false; 17 | const hasContentType = new Request('https://www.crypter.dev', { 18 | body: new ReadableStream(), 19 | method: 'POST', 20 | 21 | // @ts-ignore 22 | get duplex() { 23 | duplexAccessed = true; 24 | return 'half'; 25 | }, 26 | }).headers.has('Content-Type'); 27 | return duplexAccessed && !hasContentType; 28 | } 29 | -------------------------------------------------------------------------------- /Crypter.Web/Pages/DecryptFile.razor: -------------------------------------------------------------------------------- 1 | @* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | *@ 26 | 27 | @page "/decrypt/file/{userType:int}/{transferHashId}" 28 | 29 | Crypter - Decrypt 30 | 31 |
32 |

Decrypt File

33 | @if (!_loading) 34 | { 35 | 36 | } 37 |
38 | -------------------------------------------------------------------------------- /Crypter.Web/Pages/DecryptMessage.razor: -------------------------------------------------------------------------------- 1 | @* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | *@ 26 | 27 | @page "/decrypt/message/{userType:int}/{transferHashId}" 28 | 29 | Crypter - Decrypt 30 | 31 |
32 |

Decrypt Message

33 | @if (!_loading) 34 | { 35 | 36 | } 37 |
38 | -------------------------------------------------------------------------------- /Crypter.Web/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | *@ 26 | 27 | @page "/" 28 | 29 | Crypter 30 | 31 |
32 |

Crypter.dev

33 |

Private, encrypted file transfer and messaging

34 | 35 |
36 | -------------------------------------------------------------------------------- /Crypter.Web/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | true 8 | false 9 | false 10 | Release 11 | Any CPU 12 | FileSystem 13 | bin\Release\net7.0\publish\browser-wasm 14 | FileSystem 15 | true 16 | browser-wasm 17 | false 18 | 19 | net7.0 20 | 4cf78490-fdfa-47ee-a1be-7ae5534ecfaf 21 | 22 | -------------------------------------------------------------------------------- /Crypter.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:38083", 7 | "sslPort": 44356 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "Crypter.Web": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 23 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Crypter.Web/Shared/AppFooter.razor.css: -------------------------------------------------------------------------------- 1 | .ko-fi-img { 2 | margin: -10px -5px -10px -10px; 3 | } 4 | -------------------------------------------------------------------------------- /Crypter.Web/Shared/AppHeader.razor: -------------------------------------------------------------------------------- 1 | @* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | *@ 26 | 27 | 33 | -------------------------------------------------------------------------------- /Crypter.Web/Shared/Modal/Template/ModalBehavior.razor: -------------------------------------------------------------------------------- 1 | @* 2 | * Copyright (C) 2024 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | *@ 26 | 27 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Crypter.Web/Shared/Transfer/TabbedUploadTransferComponent.razor.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Crypter File Transfer 3 | * 4 | * This file is part of the Crypter file transfer project. 5 | * 6 | * Crypter is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * The Crypter source code is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Affero General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Affero General Public License 17 | * along with this program. If not, see . 18 | * 19 | * You can be released from the requirements of the aforementioned license 20 | * by purchasing a commercial license. Buying such a license is mandatory 21 | * as soon as you develop commercial activities involving the Crypter source 22 | * code without disclosing the source code of your own applications. 23 | * 24 | * Contact the current copyright holder to discuss commercial license options. 25 | */ 26 | 27 | namespace Crypter.Web.Shared.Transfer; 28 | 29 | public partial class TabbedUploadTransferComponent 30 | { 31 | public int ExpirationHours { get; set; } 32 | } 33 | -------------------------------------------------------------------------------- /Crypter.Web/compilerconfig.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "outputFile": "wwwroot/css/main.css", 4 | "inputFile": "wwwroot/css/main.scss" 5 | } 6 | ] -------------------------------------------------------------------------------- /Crypter.Web/compilerconfig.json.defaults: -------------------------------------------------------------------------------- 1 | { 2 | "compilers": { 3 | "less": { 4 | "autoPrefix": "", 5 | "cssComb": "none", 6 | "ieCompat": true, 7 | "strictMath": false, 8 | "strictUnits": false, 9 | "relativeUrls": true, 10 | "rootPath": "", 11 | "sourceMapRoot": "", 12 | "sourceMapBasePath": "", 13 | "sourceMap": false 14 | }, 15 | "sass": { 16 | "autoPrefix": "", 17 | "includePath": "", 18 | "indentType": "space", 19 | "indentWidth": 2, 20 | "outputStyle": "nested", 21 | "Precision": 5, 22 | "relativeUrls": true, 23 | "sourceMapRoot": "", 24 | "lineFeed": "", 25 | "sourceMap": false 26 | }, 27 | "stylus": { 28 | "sourceMap": false 29 | }, 30 | "babel": { 31 | "sourceMap": false 32 | }, 33 | "coffeescript": { 34 | "bare": false, 35 | "runtimeMode": "node", 36 | "sourceMap": false 37 | }, 38 | "handlebars": { 39 | "root": "", 40 | "noBOM": false, 41 | "name": "", 42 | "namespace": "", 43 | "knownHelpersOnly": false, 44 | "forcePartial": false, 45 | "knownHelpers": [], 46 | "commonjs": "", 47 | "amd": false, 48 | "sourceMap": false 49 | } 50 | }, 51 | "minifiers": { 52 | "css": { 53 | "enabled": true, 54 | "termSemicolons": true, 55 | "gzip": false 56 | }, 57 | "javascript": { 58 | "enabled": true, 59 | "termSemicolons": true, 60 | "gzip": false 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Crypter.Web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "crypter", 3 | "private": true, 4 | "version": "1.0.0", 5 | "author": "Jack Edwards", 6 | "license": "AGPL-3.0", 7 | "type": "module", 8 | "scripts": { 9 | "buildFunctions": "vite build --config vite.functions.config.js", 10 | "buildFileSaver": "vite build --config vite.fileSaver.config.js", 11 | "buildServiceWorker": "vite build --config vite.serviceWorker.config.js", 12 | "buildServiceWorkerNoOp": "vite build --config vite.serviceWorker.noOp.config.js" 13 | }, 14 | "devDependencies": { 15 | "path": "^0.12.7", 16 | "vite": "^6.0.5" 17 | }, 18 | "dependencies": { 19 | "@types/file-saver": "^2.0.7", 20 | "@types/ua-parser-js": "^0.7.39", 21 | "file-saver": "^2.0.5", 22 | "ua-parser-js": "^2.0.0" 23 | } 24 | } -------------------------------------------------------------------------------- /Crypter.Web/vite.fileSaver.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | build: { 6 | target: 'esnext', 7 | minify: false, 8 | lib: { 9 | entry: path.resolve(__dirname, 'Npm/src/fileSaver/fileSaver.ts'), 10 | formats: ['es'], 11 | fileName: 'fileSaver.bundle', 12 | }, 13 | outDir: path.resolve(__dirname, 'wwwroot/js/dist/fileSaver'), 14 | sourcemap: false, 15 | rollupOptions: { 16 | external: [ 17 | "Npm/src/fileSaver/serviceWorker.ts" 18 | ], 19 | } 20 | } 21 | }); -------------------------------------------------------------------------------- /Crypter.Web/vite.functions.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | build: { 6 | target: 'esnext', 7 | minify: false, 8 | lib: { 9 | entry: path.resolve(__dirname, 'Npm/src/functions.ts'), 10 | formats: ['es'], 11 | fileName: 'functions.bundle', 12 | }, 13 | outDir: path.resolve(__dirname, 'wwwroot/js/dist'), 14 | emptyOutDir: false, 15 | sourcemap: false 16 | } 17 | }); -------------------------------------------------------------------------------- /Crypter.Web/vite.serviceWorker.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | build: { 6 | target: 'esnext', 7 | minify: false, 8 | lib: { 9 | entry: path.resolve(__dirname, 'Npm/src/fileSaver/serviceWorker.ts'), 10 | formats: ['es'], 11 | fileName: 'serviceWorker', 12 | }, 13 | outDir: path.resolve(__dirname, 'wwwroot/js/dist/serviceWorker'), 14 | sourcemap: false, 15 | } 16 | }); -------------------------------------------------------------------------------- /Crypter.Web/vite.serviceWorker.noOp.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | build: { 6 | target: 'esnext', 7 | minify: false, 8 | lib: { 9 | entry: path.resolve(__dirname, 'Npm/src/fileSaver/serviceWorker.noOp.ts'), 10 | formats: ['es'], 11 | fileName: 'serviceWorker.noOp', 12 | }, 13 | outDir: path.resolve(__dirname, 'wwwroot/js/dist/serviceWorker.noOp'), 14 | sourcemap: false, 15 | } 16 | }); -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiSettings": { 3 | "ApiBaseUrl": "https://localhost/api" 4 | }, 5 | "LoggingConfiguration": { 6 | "MinimumLogLevel": "Debug" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/appsettings.Staging.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiSettings": { 3 | "ApiBaseUrl": "${API_BASE_URL}" 4 | }, 5 | "LoggingConfiguration": { 6 | "MinimumLogLevel": "Debug" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiSettings": { 3 | "ApiBaseUrl": "${API_BASE_URL}" 4 | }, 5 | "ClientTransferSettings": { 6 | "MaximumUploadBufferSizeMB": 100, 7 | "MaximumMultipartReadBlocks": 120, 8 | "InitialMultipartReadBlocks": 10, 9 | "MaximumMultipartParallelism": 2, 10 | "TargetMultipartUploadMilliseconds": 1000, 11 | "MaxReadSize": 32704, 12 | "PadSize": 64 13 | }, 14 | "LoggingConfiguration": { 15 | "MinimumLogLevel": "Information" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/css/main.scss: -------------------------------------------------------------------------------- 1 | @import 'partials/_base.scss'; 2 | @import 'partials/_navigation.scss'; 3 | @import 'partials/_encrypt.scss'; 4 | @import 'partials/_upload.scss'; 5 | @import 'partials/_decrypt.scss'; 6 | @import 'partials/_copied.scss'; 7 | @import 'partials/_input-group.scss'; -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/css/partials/_copied.scss: -------------------------------------------------------------------------------- 1 | .copiedTooltip { 2 | position: relative; 3 | 4 | .toolTipText { 5 | background-color: gray; 6 | color: #ffffff; 7 | border-radius: 5px; 8 | text-align: center; 9 | line-height: 32px; 10 | display: none; 11 | position: absolute; 12 | width: 100px; 13 | height: 32px; 14 | margin: auto; 15 | top: 0; 16 | bottom: 0; 17 | left: 0; 18 | right: 0; 19 | opacity: 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/css/partials/_decrypt.scss: -------------------------------------------------------------------------------- 1 | .decryption-details { 2 | border: 1px solid black; 3 | border-radius: 10px; 4 | 5 | &::after { 6 | content: ''; 7 | display: table; 8 | clear: both; 9 | } 10 | 11 | .details, .decryption-key { 12 | padding: 16px; 13 | float: left; 14 | } 15 | 16 | .details { 17 | 18 | h3 { 19 | text-transform: capitalize; 20 | margin-top: 0; 21 | } 22 | } 23 | 24 | .decryption-key { 25 | border-left: 1px solid black; 26 | text-align: center; 27 | 28 | input, button { 29 | display: block; 30 | margin: 12px auto; 31 | } 32 | 33 | input { 34 | width: 75%; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/css/partials/_encrypt.scss: -------------------------------------------------------------------------------- 1 | #encrypt { 2 | margin: 40px auto; 3 | max-width: 700px; 4 | } 5 | -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/css/partials/_input-group.scss: -------------------------------------------------------------------------------- 1 | .input-group-append { 2 | margin-left: -1px; 3 | } 4 | 5 | .input-group-append { 6 | display: flex; 7 | } 8 | 9 | .input-group > .input-group-append > .btn, .input-group > .input-group-append > .input-group-text { 10 | border-top-left-radius: 0; 11 | border-bottom-left-radius: 0; 12 | } 13 | 14 | .input-group-append .btn { 15 | position: relative; 16 | z-index: 2; 17 | } -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/css/partials/_navigation.scss: -------------------------------------------------------------------------------- 1 | .nav.head { 2 | .nav-item button, .nav-item a { 3 | margin: 8px; 4 | } 5 | } -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/css/partials/_upload.scss: -------------------------------------------------------------------------------- 1 | .file-upload, .message-upload { 2 | max-width: 600px; 3 | margin: auto; 4 | text-align: left; 5 | 6 | .dropzone { 7 | border-width: 4px; 8 | border-style: dotted; 9 | margin: auto auto 24px auto; 10 | text-align: center; 11 | position: relative; 12 | transition: all 200ms ease; 13 | 14 | &.dropzone-drag { 15 | background-color: rgba(27,110,194, 0.15); 16 | border-color: #1b6ec2; 17 | transition: all 200ms ease; 18 | 19 | .dz-text { 20 | color: #1b6ec2; 21 | } 22 | } 23 | 24 | &:hover { 25 | .dz-text { 26 | color: #1b6ec2; 27 | transition: color 200ms ease; 28 | } 29 | } 30 | } 31 | 32 | .dz-text { 33 | position: absolute; 34 | padding: 20px; 35 | left: 0; 36 | right: 0; 37 | transition: color 200ms ease; 38 | } 39 | 40 | #fileInput { 41 | padding: 5rem 9rem 2rem; 42 | opacity: 0; 43 | z-index: 10; 44 | 45 | &:hover { 46 | cursor: pointer; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/img/GitHub-Mark-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/img/GitHub-Mark-32px.png -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/js/blazorStartup.js: -------------------------------------------------------------------------------- 1 | const environmentMap = { 2 | "localhost": "Development", 3 | "stage.crypter.dev": "Staging", 4 | "www.crypter.dev": "Production" 5 | } 6 | 7 | Blazor.start({ 8 | environment: environmentMap[window.location.hostname] 9 | }); -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/bootstrap-icons-1.10.3/fonts/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/bootstrap-icons-1.10.3/fonts/bootstrap-icons.woff -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/bootstrap-icons-1.10.3/fonts/bootstrap-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/bootstrap-icons-1.10.3/fonts/bootstrap-icons.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FU0U1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FU0U1Z4Y.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FV0U1.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FV0U1.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FVUU1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FVUU1Z4Y.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FWUU1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FWUU1Z4Y.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FWkU1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-2Y-FWkU1Z4Y.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFU0U1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFU0U1Z4Y.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFV0U1.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFV0U1.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFVUU1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFVUU1Z4Y.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFWUU1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFWUU1Z4Y.woff2 -------------------------------------------------------------------------------- /Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFWkU1Z4Y.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crypter-File-Transfer/Crypter/c16eb11a87af70b7df637c803a8a99ccbfd1f34d/Crypter.Web/wwwroot/lib/fonts-local/google/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4iFWkU1Z4Y.woff2 -------------------------------------------------------------------------------- /Documentation/Production/Server Setup/Web Server Setup.md: -------------------------------------------------------------------------------- 1 | # Web Server Setup 2 | 3 | This document describes how to manually setup a new web server for GitHub deploys. 4 | 5 | ## Install Docker 6 | 7 | Install Docker or an equivalent. 8 | 9 | Also install Docker Compose or an equivalent. 10 | 11 | ## Configure SSH 12 | 13 | Create an SSH user and add corresponding details to the environment secrets within the GitHub repository. 14 | 15 | The user will need permissions to Docker, so add the user to the `docker` group. 16 | 17 | ## Copy the .env file 18 | 19 | Locate the `.env` file at the root of this repository, [here](../../../.env). 20 | 21 | Copy the file to the home directory of the SSH user. For example: `/home//crypter-web-container/.env` 22 | 23 | Scan and update the values in the file to ensure they are correct for the environment. 24 | 25 | ## Enable linger 26 | 27 | Enable linger to be sure the user service owned by the SSH user automatically starts after a power cycle. 28 | 29 | `loginctl enable-linger ` 30 | -------------------------------------------------------------------------------- /Environments/production/crypter.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Crypter Web and API 3 | After=docker.service 4 | 5 | [Service] 6 | Type=simple 7 | WorkingDirectory=%h/crypter-web-container 8 | ExecStart=/usr/bin/docker compose --profile web up 9 | ExecStop=/usr/bin/docker compose --profile web down 10 | Restart=on-failure 11 | 12 | [Install] 13 | WantedBy=default.target 14 | -------------------------------------------------------------------------------- /Environments/staging/crypter.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Crypter Web, API, and database 3 | After=docker.service 4 | 5 | [Service] 6 | Type=simple 7 | WorkingDirectory=%h/crypter-web-container 8 | ExecStart=/usr/bin/docker compose --profile local up 9 | ExecStop=/usr/bin/docker compose --profile local down 10 | Restart=on-failure 11 | 12 | [Install] 13 | WantedBy=default.target 14 | -------------------------------------------------------------------------------- /docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | services: 2 | api: 3 | depends_on: 4 | db: 5 | condition: service_healthy 6 | db: 7 | profiles: 8 | - db 9 | - local 10 | image: postgres:15.10 11 | expose: 12 | - "5432" 13 | ports: 14 | - ${POSTGRES_BIND_IP-[0.0.0.0]}:${POSTGRES_BIND_PORT-5432}:5432 15 | environment: 16 | POSTGRES_PASSWORD: ${POSTGRES_SUPERUSER_PASSWORD-DEFAULT_PASSWORD} 17 | POSTGRES_C_PASSWORD: ${POSTGRES_USER_PASSWORD:-DEFAULT_PASSWORD} 18 | POSTGRES_HF_PASSWORD: ${POSTGRES_HANGFIRE_USER_PASSWORD:-DEFAULT_PASSWORD} 19 | volumes: 20 | - ./Volumes/PostgreSQL/data:/var/lib/postgresql/data 21 | - ./Volumes/PostgreSQL/postgres-init-files:/docker-entrypoint-initdb.d 22 | restart: always 23 | healthcheck: 24 | test: ["CMD-SHELL", "pg_isready -d crypter -U postgres"] 25 | interval: 10s 26 | timeout: 10s 27 | retries: 5 28 | start_period: 60s 29 | --------------------------------------------------------------------------------