Questions tagged [base64]

Base64 is an encoding scheme (with some variations in the presentation) that represents binary data in an ASCII string format.

Filter by
Sorted by
Tagged with
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 ...
glimapt's user avatar
  • 11
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 ...
user avatar
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....
Vedant Jadhav's user avatar
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 ...
Elitezen's user avatar
  • 113
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 ...
Ryan Stone's user avatar
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 ...
Martin York's user avatar
  • 94.3k
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 ...
dawid's user avatar
  • 173
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. ...
Stageflix's user avatar
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 ...
Roman Shevchenko's user avatar
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: ...
user avatar
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 ...
MarcoLucidi's user avatar
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-...
flornquake's user avatar
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: ...
Guilherme Lima's user avatar
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 ...
typo's user avatar
  • 171
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 ...
David Reed's user avatar
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 ...
Matthias Herrmann's user avatar
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 ...
six8's user avatar
  • 236
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: ...
RubberDuck's user avatar
  • 30.8k
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 ...
Tobias Hermann's user avatar
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 ...
Thiago Padilha's user avatar
6 votes
3 answers
13k views

Converting vector of bytes to base64 string and back

...
anc's user avatar
  • 61
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 ...
rok's user avatar
  • 141
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: ...
mskuratowski's user avatar
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 ...
Andrei Damian's user avatar
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 ...
Ray Hamel's user avatar
  • 258
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 ...
Luke Park's user avatar
  • 255
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. :) ...
sYnfo's user avatar
  • 175
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. ...
liewl's user avatar
  • 215
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() ...
liewl's user avatar
  • 215
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 ...
CodesInValley's user avatar
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. ...
Giuseppe Crinò's user avatar
8 votes
1 answer
345 views

Barcode (Code 128)

I wrote the code below to generate Code 128 barcodes, based on the specs. ...
VBobCat's user avatar
  • 307
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 ...
Peter's user avatar
  • 1,125
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, ...
Mehow's user avatar
  • 43
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 <...
Not M. Kalashnikov's user avatar
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 ...
Kolibrie's user avatar
  • 177
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) <...
McGee.WIll's user avatar
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 ...
dylanweber's user avatar
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 ...
user1580348's user avatar
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 ...
tomaytotomato's user avatar
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: ...
Kokizzu's user avatar
  • 235
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? ...
MaZaHaKa's user avatar
  • 111
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 ...
Carrybubbles's user avatar
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 ...
Deniz's user avatar
  • 151
-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 ...
javaseaayameradost's user avatar
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? ...
Sam Jones's user avatar
  • 193
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 ...
Maggy May's user avatar
  • 143
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. ...
Glenn1234's user avatar
  • 121
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 ...
Casey's user avatar
  • 748
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 ...
W3Coder's user avatar
  • 113