Code Monkey home page Code Monkey logo

argon2.bindings's Introduction

ModernUO Discord Subreddit subscribers Twitter Follow

Ultima Online Server Emulator for the modern era!

GitHub license GitHub stars GitHub issues
GitHub build Azure Pipelines build

Requirements

Supported Operating Systems

Windows 10/11/2019/2022 MacOS 13+ Debian 11+ Ubuntu 20+ LTS
Alpine 3.18+ Fedora 39+ RedHat 8/9 CentOS 9 openSUSE 15+ SUSE Enterprise 12 SP2+ Linux Mint 17+ Arch

Required Frameworks

All Operating Systems

.NET

Windows

VC++ Redistributable 17

Development

git .NET

Supported IDEs

Jetbrains Rider 2024.1+spaceVSCodespaceVisual Studio 2022 v17.10+

Getting Started

  • Install prerequisite requirements
  • Clone this repository (or download the latest):
    • git clone https://github.com/modernuo/ModernUO.git
  • Open ModernUO.sln to start developing

Building/Publishing

  • Run ./publish.cmd [release|debug (default: release)] [os] [arch (default: x64)]
    • os - Supported operating systems
      • win - Windows 10/11/2019/2022
      • osx - MacOS 12/13/14 (Sonoma, Big Sur, Monterey)
      • linux - Linux
    • arch
      • x64 - Intel 64-bit
      • arm64 - ARM 64-bit (Windows Arm64 not supported)

Linux Prerequisites

Fedora, CentOS, RHEL, etc

dnf upgrade --refresh -y
# CentOS does not come with EPEL enabled
dnf install -y epel-release epel-next-release
dnf install -y findutils libicu libdeflate-devel zstd libargon2-devel

Ubuntu, Debian, etc

apt-get update -y
apt-get install -y libicu-dev libdeflate-dev zstd libargon2-dev

OSX Requirements

brew install icu4c libdeflate zstd argon2

Running the Server

  • Follow the publish instructions
  • Run ModernUO.exe or dotnet ModernUO.dll from the Distribution directory on the

Troubleshooting / FAQ

Want to sponsor?

Thank you for supporting us! You can find out how by visiting the sponsors page.

Collaborators

Kamron Batman Mark1145

Thanks

  • RunUO Team & Community
  • Voxpire, the ServUO Team & Community
  • Karasho, Jaedan and the ClassicUO Community



Development Tools & Plugins provided with ♥ by
JetBrains Material Theme

argon2.bindings's People

Contributors

kamronbatman avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

argon2.bindings's Issues

Unable to find an entrypoint for decode_string in libargon2.dll

The following method fails because there seems to be a mismatch between the entry point names in Argon2.cs and the content of libargon2.dll in the 1.16.1 package.

[MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static unsafe Argon2Error Decode(Argon2Context ctx, ReadOnlySpan<byte> str, int type)
    {
        fixed (byte* p_str = str)
        {
            return decode_string(ctx, p_str, type);
        }
    }

%USERPROFILE%\.nuget\packages\argon2.bindings\1.16.1\runtimes\win-x64\native>dumpbin /exports libargon2.dll
Microsoft (R) COFF/PE Dumper Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file libargon2.dll

File Type: DLL

  Section contains the following exports for libargon2.dll

    00000000 characteristics
    FFFFFFFF time date stamp
        0.00 version
           1 ordinal base
          22 number of functions
          22 number of names

    ordinal hint RVA      name

          1    0 00001050 argon2_ctx
          2    1 00001D10 argon2_encodedlen
          3    2 00001B30 argon2_error_message
          4    3 00001370 argon2_hash
          5    4 00001000 argon2_type2string
          6    5 00001860 argon2_verify
          7    6 000019F0 argon2_verify_ctx
          8    7 000019C0 argon2d_ctx
          9    8 00001690 argon2d_hash_encoded
         10    9 00001700 argon2d_hash_raw
         11    A 000019A0 argon2d_verify
         12    B 00001B00 argon2d_verify_ctx
         13    C 000019D0 argon2i_ctx
         14    D 000015A0 argon2i_hash_encoded
         15    E 00001620 argon2i_hash_raw
         16    F 00001990 argon2i_verify
         17   10 00001B10 argon2i_verify_ctx
         18   11 000019E0 argon2id_ctx
         19   12 00001770 argon2id_hash_encoded
         20   13 000017F0 argon2id_hash_raw
         21   14 000019B0 argon2id_verify
         22   15 00001B20 argon2id_verify_ctx

  Summary

        2000 .data
        2000 .pdata
        B000 .rdata
        1000 .reloc
        1000 .rsrc
       14000 .text
        1000 _RDATA

M1 Runtime add issue

Steps:

❯ git submodule init
Submodule 'argon2-src' ([email protected]:P-H-C/phc-winner-argon2.git) registered for path 'argon2-src'
❯ git submodule update
Cloning into '/Users/iskiridomov/Personal/Argon2.Bindings/argon2-src'...
Submodule path 'argon2-src': checked out 'f57e61e19229e23c4445b85494dbf7c07de721cb'
❯ cd argon2-src
❯ make
Building without optimizations
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread  src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/ref.c src/run.c -o argon2
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread -dynamiclib -install_name /usr/lib/libargon2.1.dylib   src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/ref.c -o libargon2.1.dylib
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread   -c -o src/argon2.o src/argon2.c
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread   -c -o src/core.o src/core.c
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread   -c -o src/blake2/blake2b.o src/blake2/blake2b.c
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread   -c -o src/thread.o src/thread.c
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread   -c -o src/encoding.o src/encoding.c
cc -std=c89 -O3 -Wall -g -Iinclude -Isrc -pthread   -c -o src/ref.o src/ref.c
ar rcs libargon2.a src/argon2.o src/core.o src/blake2/blake2b.o src/thread.o src/encoding.o src/ref.o
sed '/^##.*$/d; s#@PREFIX@#/usr#g; s#@EXTRA_LIBS@##g; s#@UPSTREAM_VER@#ZERO#g; s#@HOST_MULTIARCH@#lib#g; s#@INCLUDE@#include#g;' < 'libargon2.pc.in' > 'libargon2.pc'

Add file to runtime osx-arm64/native
Add into cproj

<Content Include="runtimes\osx-arm64\native\libargon2.dylib">
            <Pack>true</Pack>
            <PackagePath>runtimes/osx-arm64/native</PackagePath>
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

Build package

❯ dotnet build
MSBuild version 17.4.0+18d5aef85 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Argon2 -> /Users/iskiridomov/Personal/Argon2.Bindings/bin/Debug/net6.0/Argon2.Bindings.dll
  Argon2 -> /Users/iskiridomov/Personal/Argon2.Bindings/bin/Debug/net7.0/Argon2.Bindings.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Add package locally and install it

nuget add /Users/iskiridomov/Personal/Argon2.Bindings/bin/Debug/Argon2.Bindings.1.14.3.nupkg -Source ./packages
 dotnet add package Argon2.Bindings -s ./packages

Add simple call

var hasher = new Argon2PasswordHasher();
var myhash = hasher.Hash("mypassword");
_logger.LogInformation(myhash);

Call failed with trace

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.Security.Cryptography.Argon2Exception: Error during Argon2 hashing: (-3) -3
         at System.Security.Cryptography.Argon2PasswordHasher.Hash(ReadOnlySpan`1 password, ReadOnlySpan`1 salt, Span`1 hash)
         at System.Security.Cryptography.Argon2PasswordHasher.Hash(ReadOnlySpan`1 password, ReadOnlySpan`1 salt)
         at System.Security.Cryptography.Argon2PasswordHasher.Hash(ReadOnlySpan`1 password)
         at Marketplace.Controllers.WeatherForecastController.Get() in /Users/iskiridomov/RiderProjects/Marketplace/Marketplace/Controllers/WeatherForecastController.cs:line 27
         at lambda_method2(Closure, Object, Object[])
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
         at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
         at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Sametime argon2 cli run successfully

❯ chmod +x argon2
❯ echo -n "123456789012345678901234567890" | ./argon2 "salzwasser" -i -t 3 -m 12 -p 1
Type:		Argon2i
Iterations:	3
Memory:		4096 KiB
Parallelism:	1
Hash:		545a0252727d0518ac160d122d1dad04fa228c706f90d60bf561a5c0f5acb52d
Encoded:	$argon2i$v=19$m=4096,t=3,p=1$c2Fsendhc3Nlcg$VFoCUnJ9BRisFg0SLR2tBPoijHBvkNYL9WGlwPWstS0
0.013 seconds
Verification ok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.