pyrote
BadCertificate error using deno 1.25.4
Yes deno.land is using a Let's Encrypt certificate.
I installed 1.25.4 on a Ubuntu 22.04.4 LTS machine and can load that cliffy module.
Just running a file with,
downloads the module correctly. Try running that as a test and see if it downloads the module in your environment.
7 replies
BadCertificate error using deno 1.25.4
Have you ran, sudo apt-get upgrade ca-certificates
The UnknownIssuer message makes it seem like Deno can't find a valid certificate and you may not have the latest one for Let's Encrypt.
Can you upgrade your version of Deno? That version is a few years old.
7 replies
How do I use crypto.subtle.importKey to verify the signature sent by Admob SSV ?
It looks like that JSON file is using a P-256 key. It matches what OpenSSL generates for prime256v1. So to load the key, this is what you would do.
I don't have any signatures to test it with so can't be sure. Google should really include the algorithm in that verifier-keys.json file.
4 replies
Deno Oak doesnt work when compiled to `.exe`
I tried your example and some Oak code with a route and error handler. Neither runs correctly when compiled.
Tried Deno 1.41.3 and 1.42.1 on Linux Devuan 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64 GNU/Linux
Tried deno compile -r to reload the cache.
When you run the compiled binaries under strace they are looking for files in the .cache directory of the user's home directory which seems odd. Other compiled Deno code doesn't do that. Then the binary is just hung on a epoll_wait() call.
8 replies
Setting Deno.Command priority and affinity (on windows)
You can use the windows "start" cmd to set priority and affinity.
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/start
cmd /c start "" /high /affinity 3 "ffmpeg.exe" (args go here)
The affinity is a Hex number representing a bitmask for the CPU cores. Right most bit is the first CPU core. So 3 is CPU core 0 and 1. F would be cores 0,1,2,3.
3 replies
How to encrypt and decrypt files from S3 without loading the hole content into memory?
The Web Crypto API that Deno uses has no support for streams so I don't think its possible with the basic crypto.subtle. You could break the data into chunks and encrypt each chunk separately but then you are basically creating your own file format that only your code understands. Chunking can also potentially weaken the encryption if you don't handle IV generation and auth tags properly.
I would look for a encryption library that can handle streams. Node's crypto module has support for ReadStreams so maybe Deno's Node compatibility is far enough along that it supports streams.
4 replies
deno command stdin, stdout continous reading
If I replace config.EXE with "echo" the Deno code behaves correctly and prints stdout. Also tried a mock bash script too so the issue seems to be with that exe. Have you tried printing result.stderr to see if the exe is outputting any error messages?
4 replies
how to compress string into string
Using base91 to encode the raw compressed data would be a little more space efficient than base64.
https://deno.land/x/base91@v1.1
The length a composition of your strings is going to dictate if compression will help or not. Compression works well with long repetitive data so if the strings are short and basically random, the compressed size may be larger than the string alone.
Zstd and brotli are two popular compression algorithms to try.
https://deno.land/x/zstd_wasm@0.0.21
https://deno.land/x/brotli@0.1.7
6 replies
Can't spawn a shell properly using Deno!
If you only care about stdout and stderr and you can wait for the process to complete you could use something like this,
Calling spawn() creates a subprocess that has to be accessed with readable streams. Thus the ^^^ getWriter()/getReader() needs to be used. If you need to interact with the command while its running you would use spawn().
38 replies
`RangeError: Offset is outside the bounds of the DataView` when trying to encrypt with AES-CRT
I'm not sure if that modules CTR implementation is supposed to be very low level or isn't finished yet. Its expecting the input data to be in blocks of 16 bytes. If you data isn't a multiple of 16 bytes you get that error. Which shouldn't be a requirement for CTR.
You may want to look at the standard JavaScript crypto.subtle API. Its built into Deno.
https://deno.land/api@v1.39.1?s=SubtleCrypto
The Mozilla docs provide some good examples of how to use it.
https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/encrypt#aes-ctr
6 replies
Simple Deno program on Windows quits after 20 seconds
I would check the Windows Event Viewer to see if anything was logged about your program. Then you could use Process Monitor https://learn.microsoft.com/en-us/sysinternals/downloads/procmon
To watch your program and see if anything its doing is failing for some reason.
4 replies
Property 'params' does not exist on type 'Context<State, Record<string, any>> ... what to do?
I've fought with this when Oak made major updates.
Try importing the RouterContext from oak.
change the function to (context: RouterContext<string> )
Also there is a helper for grabbing query params that can help too.
Import helpers from oak,
3 replies
bad resource id with node:crypto
It looks like its a bug/unfinished feature in Deno's node:crypto implementation. If you change your code to use 'aes-128-cbc' and the key to randomBytes(16) it will run.
Can you use Deno's native crypto.subtle encryption/decryption?
10 replies
Dates don't increment correctly
It could be because of the local system's time zone. newDate.getDate() will return the date based on the local time. Which can be one day less than the UTC date depending on the time of day. You could use newDate.getUTCDate() if you want to keep everything in UTC.
3 replies