Nightshade is a tool built at the University of Chicago that tries to pick the part of the image that is described in the associated text and then blurs its boundaries. In this way AI training software has a hard time to find the subject in the downloaded image.
22 January 2024
2 December 2023
LofgoFail: BIOS vendor logo loader vulnerability
Logofail, a vulnerability in the loading of vendor logo image files from BIOS bypasses secure boot measures from all major BIOS vendors.
More info...9 October 2023
Negative news gets more clicks
A study in Nature Human Behaviour shows that people are more likely to pick negative news articles to read:
- For every negative word in a news title the chance a user clicks on it increases by 2.3%.
- For every positive word in a news title the chance a user clicks on it decreases by1%.
26 September 2023
RSA and other encryption servers vulnerable to 25-year old Marvin attack
Among others, popular OpenSSL and GnuTLS implementations are vulnerable.
The authors recommend to stop using RSA PKCS#1 v1.5 and switch to Elliptic curve Diffie-Hellman.
They suspect that any cryptographic library using general purpose integer implementations ( (default mode of OpenSSL's BIGNUM, Java's BigInteger, Python's int, Rust's apin...) is vulnerable.
What can the attackers gain?
- The attacker is able to decrypt RSA ciphertexts and forge signatures.
- For a TLS server that defaults to RSA encryption key exchanges, that means the attacker can record a session and decrypt it later.
more...
15 September 2023
When you can't pin a .exe to your windows 11 start menu
I have a program on my new Windows 11 machine, for which I'd like to add the .exe to my start menu.
When I use the right click menu on the .exe to do this, nothing happens.
Here's how I solved the problem:
- Create a shortcut (myProgram.lnk) for the myProgram.exe
- Copy the shortcut to your desktop
- Use the right click menu on the shortcut to pin it to your start menu (now this works for me!)
- Throw away the shortcut on your desktop (if you don't like it there)
9 September 2023
Processing LocalDateTime with Moshi in Java
Moshi is a library for marshalling/unmarshalling JSON. The Moshi API is very similar to the API of its predecessor Gson. Just like Gson, Moshi does not have support for LocalDate(Time) processing. This is the recommended Java Date/Time representation, so Moshi does not work out of the box for Java, and that's a shame.
Here's how you can solve this, for LocalDateTime. The procedure for LocalDate is similar.
Option 1: write an Adapter from scratch
1. Write the Adapter class
public class LocalDateTimeAdapter {
// Specify in which format you want your DateTime
private final DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
@ToJson
public String toText(LocalDateTime dateTime) {
return dateTime.format(formatter);
}
@FromJson
public LocalDateTime fromText(String text) {
return LocalDateTime.parse(text, formatter);
}
}
2. Add the adapter when building Moshi
Moshi moshi = new Moshi.Builder()
.add(new LocalDateTimeAdapter())
.build();
// That's all!
// Now just parse (or serialise) your data as normal
// Here serialising a Ticket object
JsonAdapter<Ticket> jsonAdapter = moshi.adapter( Ticket.class);
System.out.println(jsonAdapter.indent(" ").toJson(ticket));
Option 2: write an Adapter that delegates to Moshi's Date adapter
1. Add the Moshi adapters library
I'm using gradle and add the dependency to build.gradle.kt, in addition to the moshi library that was already theredependencies {
implementation("com.squareup.moshi:moshi:1.15.0")
implementation("com.squareup.moshi:moshi-adapters:1.15.0")
//...
}
2. Write the Adapter class
In the adapter I'm converting LocalDateTime to/from Date and then use the Moshi adapter to convert the Date to/from JSON.
//...
// Do NOT import this from com.squareup.moshi.Rfc3339DateJsonAdapter, that one's deprecatedimport com.squareup.moshi.adapters.Rfc3339DateJsonAdapter;
public class DelegatingLocalDateTimeAdapter {
// adding .nullSafe() to the adapter allows it to write null dates in json rather than skipping them
private static final JsonAdapter<Date> ADAPTER = new Rfc3339DateJsonAdapter().nullSafe();
@ToJson
public String toJson(LocalDateTime timestamp) {
return ADAPTER.toJson(Date.from(timestamp.atZone(ZoneId.systemDefault()).toInstant()));
}
@FromJson
public LocalDateTime fromJson(String json) throws IOException {
return LocalDateTime.ofInstant( ADAPTER.fromJson(json).toInstant(), ZoneId.systemDefault());
}
}
3. Add the adapter when building Moshi
Moshi moshi = new Moshi.Builder()
.add(new DelegatingLocalDateTimeAdapter())
.build();
// That's all!
// Now just parse (or serialise) your data as normal
// Here serialising a Ticket object
JsonAdapter<Ticket> jsonAdapter = moshi.adapter( Ticket.class);
System.out.println(jsonAdapter.indent(" ").toJson(ticket));
8 August 2023
Jetbrains 2023.2 releases
Some highlights:
- AI assistance (chat GPT) integration beta.
- process gitlab merge requests (merge them in intellij)
- multiple member and multi caret selection in refactorings
- HTTP client enhancements (view result as HTML...)