Postlar filtri


#memes@ilyosshares


implemented in Java:

import java.util.Scanner;

public class HiddenText {
public static void main(String[] args) {
Scanner in = new Scanner(System.in).useDelimiter("\n");
boolean isRunning = true;
while (isRunning) {
System.out.println("Select action:\ne - encode\nd - decode\nq - quit");

String action = in.next();
switch (action) {
case "e" -> {
System.out.println("Enter character: ");
char c = in.next().charAt(0);

System.out.println("Enter text to hide: ");
String secret = in.next();

System.out.println("Encoded: " + encode(c, secret));
}
case "d" -> {
System.out.println("Enter text containing hidden text");
String encoded = in.next();
System.out.println("Decoded: " + decode(encoded));
}
case "q" -> {
isRunning = false;
}
default -> System.out.println("Invalid action");
}
}
}

public static String encode(char c, String secret) {
StringBuilder sb = new StringBuilder().append(c);

for (byte b : secret.getBytes()) {
sb.append(byteToVariation(b));
}

return sb.toString();
}

public static String decode(String encoded) {
char[] chars = encoded.toCharArray();
byte[] data = new byte[chars.length];
int l = 0;

for(int i = 0; i < chars.length; i++) {
int x = chars[i] & 0xFE00;

if (x == 0xFE00) {
data[l++] = (byte) ((chars[i] & 0xF) - 128);
} else if (x == 0xDA00) {
i++;
data[l++] = ((byte) ((chars[i] & 0xFF) + 16 - 128));
}
}

return new String(data, 0, l);
}

public static char[] byteToVariation(byte b) {
int i = b + 128;
int codePoint;
if (i < 16 ) {
codePoint = 0xFE00 | i;
} else {
codePoint = 0xE0100 | (i - 16);
}
return Character.toChars(codePoint);
}
}

#snippets@ilyosshares


Smuggling arbitrary data through an emoji

Is it really possible to encode arbitrary data in a single emoji?

tl;dr: yes, although I found an approach without ZWJ. In fact, you can encode data in any unicode character. This sentence has a hidden message󠅟󠅘󠄐󠅝󠅩󠄜󠄐󠅩󠅟󠅥󠄐󠅖󠅟󠅥󠅞󠅔󠄐󠅤󠅘󠅕󠄐󠅘󠅙󠅔󠅔󠅕󠅞󠄐󠅝󠅕󠅣󠅣󠅑󠅗󠅕󠄐󠅙󠅞󠄐󠅤󠅘󠅕󠄐󠅤󠅕󠅨󠅤󠄑.


#readings@ilyosshares


HabiKatura dan repost
Ўша гап ❌
Ўшал байт ✅

@habikatura


Parallel Minder dan repost


Completed Viewfinder

#games@ilyosshares


I once met a person with a glass eye. They didn't tell me. It came out in conversation.

#puns@ilyosshares


DO NOT ERASE

#memes@ilyosshares


Mice with balls

#memes@ilyosshares




technical debt ❌
code now pay later ✅

#memes@ilyosshares


What Okta Bcrypt incident can teach us about designing better APIs

The Bcrypt algorithm was used to generate the cache key where we hash a combined string of userId + username + password. Under a specific set of conditions, listed below, this could allow users to authenticate by providing the username with the stored cache key of a previous successful authentication.


#readings@ilyosshares


Some terminal frustrations

What’s the most frustrating thing about using the terminal for you?


#readings@ilyosshares


Fazilat writes dan repost


Java Stream API: 3 Things Every Developer Should Know About

Stream API is a powerful yet simple-to-understand set of tools for processing sequences of elements. When used correctly, it helps reduce a lot of unnecessary code, makes programs more readable, and improves application performance.


#readings@ilyosshares


Developer Philosophy

Some code seems to work correctly by accident, because the circumstances which could cause it to receive bad inputs and fail are ruled out by the structure of the other code surrounding it. I dislike this. Although technically the code may be free of bugs, restructuring the other code is now difficult and dangerous.


#readings@ilyosshares




If your computer isn't working properly and you don't understand why, just hit it a bunch of times with a hammer.

It still won't work properly, but at least it’ll have a reason.


#memes@ilyosshares



20 ta oxirgi post ko‘rsatilgan.