Questions tagged [base64]
Base64 is an encoding scheme (with some variations in the presentation) that represents binary data in an ASCII string format.
50
questions
1
vote
1
answer
508
views
Rust - Hexadecimal to Base64 conversion (Cryptopals challenge 1)
Here's my solution to the first challenge of the Cryptopals Crypto Challanges (https://cryptopals.com/sets/1/challenges/1).
I decided to use a cargo workspace to structure my project with the library ...
2
votes
1
answer
268
views
Base64 encoder in Assembly x86-64 Linux language
We were asked to create a Base64 encoder for Assembly x86-64 on Linux. Was wondering how my code below could be improved, be it notation or anything else. We only had Assembly for 3 months so I'm not ...
7
votes
2
answers
2k
views
C code to convert hexadecimal string to base64
I've written a program to convert a hex-encoded string to base64, and here is my code. My main concerns are:
Optimizations - Is my code sufficiently optimized and if any more optimization is possible....
1
vote
1
answer
59
views
Function that decodes all values of a given object from Base64
I have function decodeVals in NodeJS that decodes all of the values of the given object from Base64 to ASCII. This is achieved by traversing the values of said ...
2
votes
1
answer
33
views
SVG hue navigation bar
I've created a navigation spacer bar that has a hue background. To separate different aspects of content it was imported to Inkscape then exported as an SVG. It uses base64 image which I’m not sure is ...
8
votes
1
answer
289
views
base64 iterators
Was a tiny bit bored reading authentication protocols.
Needed to clear the mind and read some base64 encode text.
So I implemented these iterators that will encode or decode base64 text.
Not sure ...
3
votes
2
answers
91
views
Converting a natural number to a permutation matrix in Python. How to speed it up perhaps avoiding messing around with lists, sets and dicts?
It is something a bit complex to explain here, but the code bellow takes a 128-bit number and converts it into a permutation matrix, a beast which I have already faced before. The matrix is ...
2
votes
1
answer
6k
views
AES-256-CBC encrypt and decrypt files in Python
I wrote a simple algorithm to encrypt and decrypt files in Python using aes-256-cbc.
...
2
votes
0
answers
89
views
Ecommerce site shipping data
I have REST API written on laravel and front end on vue.js. It is a dashboard for an ecommerce store where you can connect to post shipment service API to upload order shipment data and get tracking ...
0
votes
1
answer
253
views
Cryptopals first challenge - hexadecimal to base64
I've just started the cryptopals-challenge, and now wanted to show my solution to the first challenge here:
...
7
votes
1
answer
268
views
base64 encoding and decoding tool
I wanted to understand how base64 encoding (and decoding) works so I implemented this tool in the spirit of "classic UNIX tools" (read from stdin, write to stdout).
I'd like to get general feedback ...
5
votes
1
answer
3k
views
Convert a hex string to base64
I wrote a program that converts a hex-encoded string to base64. It's my solution to the first of the Cryptopals challenges.
My main concerns are:
Portability. I don't want to rely on implementation-...
1
vote
1
answer
820
views
Hex string to Base64 in Haskell
This is my take on the first challenge on the cryptopals crypto challenges list. I think that i made it quite simple but i feel like it is possible to optimize it further. Any suggestion?
The code:
...
7
votes
1
answer
227
views
Bash script to encode images in base64 and generate a CSS file from them
These are the first lines of code I've ever written. I've been interested in the idea of learning to program for quite a while, but never really pulled the trigger, and now I've been playing around ...
4
votes
0
answers
57
views
Translating Python to Rust: reading a Salesforce ID from a string
As a first project in Rust, I'm translating an existing, working piece of Python code. This code's purpose is to convert a 15-character Salesforce Id (which is guaranteed to be ASCII, exactly 15 bytes ...
2
votes
1
answer
2k
views
C++ ASCII To Base64 String Encoding
My Base64 encoder class converts a string with ascii characters to a base64 encoded string with padding if required. Note that I'm not using istream as the input ...
5
votes
2
answers
1k
views
Python optimized base64 writer for streamed files
I needed to make a base64 file encoder where you can control the read buffer size. This is what I came up with and it's quite fast. It might be able to be simpler but still maintain its performance ...
2
votes
1
answer
975
views
Convert hex to base64 (Cryptopals challenge 1)
I've been spending some time learning Rust and I came across the Cryptopals Challenges.
This is my implementation of challenge 1
Convert hex to base64 The string:
...
3
votes
1
answer
898
views
Base64 string ↔ float array
I need to convert f32 arrays with a fix length to base64 representation and back.
My current code looks like this. It works, but it feels way too complicated.
How ...
1
vote
1
answer
259
views
Base64 iterator adaptor for Rust
As a Rust learning exercise, I'm working on implementing cryptopals challenges using iterators to perform lazy processing of data. For the first challenge, this is a base64 decoder implemented as an ...
6
votes
3
answers
13k
views
3
votes
0
answers
1k
views
Send Opencv::Mat image from Qt application to HTML client, using websocket
I wrote an application in C++ using Qt 5.7, basically is a websocket server, using qwebsocket for this, capable to send an image elaborated with OpenCV to an HTML client.
In order to do this I encode ...
2
votes
0
answers
139
views
Send image between apps
I have an ASP.NET CORE API app and now I have an endpoint like:
...
3
votes
1
answer
4k
views
Converting to and from Base64 using OpenSSL API
I am trying to get a working and good version of base64 conversions using OpenSSL. My alternatives were an implementation from an answer on SO and Boost (which I didn't chose because I read that is ...
3
votes
1
answer
4k
views
Encode strings as base64
I have this function I've written to encode strings of binary data as base64 strings. I'd like to see if there are areas where it could be improved, specifically:
Is the function correct? Are there ...
7
votes
1
answer
3k
views
Base64 implementation in C#
I've written the following unsafe C# method to convert a byte array to Base64 encoding. It works, but it runs at a significantly slower rate than the built-in ...
5
votes
1
answer
2k
views
Hex string to Base64
The base64 decode algorithm is taken directly from Base64 wiki page. This exercise is meant to help me learn Rust, so any pointers in that general direction are very welcome. :)
...
5
votes
1
answer
2k
views
Convert hex to base64, part 2
Original question
Reimplemented solution following JS1's answer.
Changed bit string hack to bitwise operations to get the corresponding base64 index values.
...
3
votes
1
answer
4k
views
Matasano Cryptopals Challenge 1: convert hex to base64
Cryptopals challenge 1
Using binary strings to convert from hex to binary felt kinda hacky. I'd like to hear if there are better ways to do that.
I used memcpy() ...
6
votes
2
answers
569
views
Unix-to-Unix Encoding (Uuencoding)
Uuencoding is historically used to encode emails. Instructions for creating a Uuencoder are:
Start with 3 bytes from the source, 24 bits in total.
Split into 4 6-bit groupings, each representing a ...
4
votes
1
answer
1k
views
Base64 encoder and decoder
I'd like to have some feedback on this small snippet I wrote to implement a base64 encoder and decoder.
Specifically, I'm not sure I'm handling padding in the best way possible.
...
8
votes
1
answer
345
views
Barcode (Code 128)
I wrote the code below to generate Code 128 barcodes, based on the specs.
...
2
votes
1
answer
82
views
Something to store any (standard) data in python
I decided to try make my own way to save normal python data yesterday after coming across the minecraft NBT format, it's more limited than cPickle but appears to produce shorter results and so far ...
4
votes
1
answer
170
views
Matasano cryptopals: Conversion to base 64 (with generic types)
My main interest is in how I have handled the generics and if it's idiomatic. I want the user to be able to specify what kind of integer type they would like to use for the encoding (u8, u16, u32, ...
7
votes
2
answers
401
views
Base64 encoding implementation
I am learning C and decided to make an implementation of Base64 encoding according to the info Wikipedia provides about it.
My main question is: should I declare the index_table array inside the <...
6
votes
2
answers
5k
views
Java conversion of base 16 to base 64
I wrote a solution in Java to solve the problem here. I use BigInteger to convert first from base 16 to base 10, then base 10 to base 64.
This seems quite ...
5
votes
2
answers
11k
views
PHP Base64 ByteArray Decoder
I have a third party system that submits what I am assuming is a byte array data from OBDII port on our fleet vehicles.
I was getting values like:
AA== (bool)
<...
5
votes
1
answer
1k
views
Encoding a string into base64
I'm trying to create a simple HTTP client. In order to make one that is standard compliant, I must be able to extract user information from a URI and convert it to base64 and send it via an ...
2
votes
0
answers
706
views
Get local Dropbox path with Delphi XE7
I've put together a function in Delphi XE7 which returns the Dropbox directory path on my machine, as this path can be customized by the user.
This function currently works on my computer, but it ...
2
votes
1
answer
1k
views
Generating HMAC
I had been working on several projects that required Header Message Authentication Codes to be generated when brokering files with 3rd parties like Netflix.
Unfortunately on older systems like ...
4
votes
1
answer
2k
views
Convert int64 to custom base64 number string
I want to convert int64 to custom base 64 number string, with this specification:
...
5
votes
2
answers
163
views
toBase64 encoder
My code convert text to Base64. I used the algorithm without bit operations. What do you think about my code?
...
1
vote
1
answer
349
views
Base64 encoder optimization
Base64 is a widely used encoding mechanism to allow arbitrary binary content to be transferred as printable text. This program is designed to take binary file as input and produce a Base64-encoded ...
5
votes
2
answers
1k
views
Proper usage of "using" statement in base64 encode method
I used the example on here, but with little changes in order to write a base64 encoder method. I have a few points about the code:
I would like to use using ...
-1
votes
1
answer
3k
views
Decrease file size of encrypted file
I am making a Cryptography application and I noticed that the encrypted file is approximately 2 times bigger because I am encoding the files in base64. Are there any file encodings that take less ...
9
votes
2
answers
30k
views
Checking MIME Type from a base64 string
I've written the following extension to determine the MIME type of a base64 string. It's worked in my local tests, but can anyone point out issues or alternate methods?
...
4
votes
2
answers
1k
views
Speed optimisation and general tips for base64 encoding/decoding functions in C
So far, the below code appears to work well. It operates pretty fast, but I was wondering if it's possible to make it faster. I'm also looking for general tips on what I might be doing wrong and what ...
2
votes
0
answers
1k
views
Performance Tuning Base64 encoding
I've been trying to get a relatively optimized version of base64 encoding that works against files. However, I've made several attempts and haven't gotten anything much faster than what I have here. ...
9
votes
2
answers
3k
views
Base64 encoder/decoder optimizations
I've written a Base64 encoder/decoder, which works great. Now I want to see if I can get it working better. I've optimized as much as I can think of, but it may be missing some things. The encoder can ...
1
vote
1
answer
409
views
Perl CGI script to respond to erroneous Base64 image requests
I often get lines like this in my Apache error log:
File does not exist: /path/to/www/data:image/gif;base64,R0lGODlhBgAGAIAOAP/yH5BAEACAEALAAAAAAGGAYAAAIJhB0Xi5vOoFwFADs=
Obviously, this is due to ...