Home

writeonly

Writeonly describes a design element in software and hardware where a value can be written or supplied but cannot be read back. It is used to enforce unidirectional data flow, protect sensitive information, or constrain how data is produced and consumed.

In programming, a write-only construct typically exposes a setter without a corresponding getter. For example, in

Common use cases include protecting secrets after they are processed (such as hashing a password immediately

Limitations and considerations include potential debugging difficulties, since you cannot inspect the stored value, and possible

In hardware, write-only memory or registers refer to storage that can be written to but not read

a
language
with
properties,
a
write-only
property
might
look
like:
public
string
Password
{
set
{
_passwordHash
=
Hash(value);
}
}
This
allows
code
to
assign
a
value
but
prevents
retrieval
of
the
value
itself.
Some
languages
implement
this
via
a
setter-only
property,
or
through
an
API
that
provides
a
setPassword(...)
method
without
a
corresponding
getPassword()
method.
The
concept
can
also
be
achieved
with
access
controls
or
dedicated
methods
that
do
not
return
the
stored
data.
on
input),
enforcing
one-way
data
entry,
and
supporting
auditing
or
data-flow
constraints
where
the
produced
value
should
not
be
leaked
or
re-read.
complications
with
serialization
or
testing.
Writeonly
interfaces
can
be
confusing
to
users
and
may
require
additional
documentation.
In
practice,
writeonly
patterns
are
chosen
when
security,
privacy,
or
architectural
constraints
justify
withholding
read-back
access.
from.
This
is
uncommon
in
general-purpose
systems
but
arises
in
specialized
devices
or
historical
architectures,
where
write
operations
are
needed
without
exposing
the
contents.